#include void change_to_4(int *y) { *y = 4; } void change_to_max_y(int z[4][4], int a, int b) { int x; x = 0; while (x < 4) { int y; y = 0; while (y < 4) { if (y >= (a - 1) && y <= (4 - b)) change_to_4(&z[y][x]); y++; } x++; } } void ft_putchar(char c) { write(1, &c ,1); } int main(void) { int str[16] = {3, 3, 1, 2, 1, 2, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3}; int matrix[4][4] = {{0}}; int a; int b; a = 0; b = 4; while (a < 4 && b < 8) { change_to_max_y(matrix, str[a], str[b]); a++; b++; } int i; int j; i = 0; while (i <= 3) { j = 0; while (j <= 3) { ft_putchar(matrix[i][j] + '0'); j++; } ft_putchar(0x0a); i++; } }