/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* check.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cchauvet int ft_verif_line(int nb_tower_viewable_in, int *line, int size) { int i; int j; int nb_tower_viewable_out; i = 0; j = 0; nb_tower_viewable_out = 1; while (i < size) { j = 0; while (line[j] < line[i]) { if (i == j + 1) break ; j++; } if (line[j] < line[i]) nb_tower_viewable_out++; i++; } return (nb_tower_viewable_out);// == nb_tower_viewable_in); } int *ft_verif(int *tab_user, int *tab_gen, int size) { int i; int j; int *line; i = 0; line = malloc(sizeof(*line) * size); while (i < size * 4) { j = 0; while (j < size * size) { ft_verif_line(tab_user[i], line, size); j++; } i++; } }