/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* tools_2.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/09 15:54:00 by erey-bet #+# #+# */ /* Updated: 2022/12/09 15:54:03 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ #include "push_swap.h" int put_error(void) { write(2, "Error\n", 6); return (1); } char **set_only_space(char *argv[], int i) { int x; x = 0; while (argv[i][x]) if (ft_strchr("\a\b\t\n\v\f\r", argv[i][x++]) != NULL) argv[i][x - 1] = ' '; return (argv); } int if_there_is_double(long *tab, int y) { int i; int x; i = 0; while (i < y) { x = 0; while (x < y) { if (tab[i] == tab[x] && i != x) return (1); x++; } i++; } return (0); }