/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* gen.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cchauvet #include #include int *ft_gen_row(int *tab, int size, int seed, int row_number) { int i; i = 1; tab[0] = seed; while (i < size) { tab[i] = size % (tab[i - 1] + seed + 1); i++; } } int *ft_gen(int size) { int *tab; int i; int seed; tab = malloc(sizeof(*tab) * size * size); seed = 0; while (seed < size * size) { ft_gen_row(tab, 4, seed, 1); seed++; } return (tab); } void ft_putchar(char c) { write(1, &c, 1); }