int check_first_line(char *map) { int lenum; int i; lenum = len_num(map); i = lenum; if (map[i] == '\n' || map[i] == map[i + 1] || map[i] == map[i + 2]) return (-1); if (map[i + 1] == '\n' || map[i + 1] == map[i + 2]) return (1); if (map[i + 2] == '\n') return (1); if (map[i + 3] != '\n') return (-1); return (lenum); }
int *convert_t(char *t, char c, t_tabi *tabi) { int *tab; char **c_b; int i; i = 0; c_b = ft_strsplit(t, c); if (!(tab = (int *)malloc((sizeof(int) * len_num(t, c) + 1)))) return (NULL); while (c_b[i]) { tab[i] = ft_atoi(c_b[i]); i++; } ft_free_tab(&c_b); tabi->x = i; return (tab); }
int check_map(char *map) { int start; int num_len; if (!(num_len = len_num(map))) return (1); if (checkif_numb(map, num_len)) return (1); if ((start = check_first_line(map)) == -1) return (1); if (check_map_char(map, start)) return (1); if (minimun_length(map)) return (1); if (check_map_cperline_lines(map, start)) return (1); return (0); }