43 lines
1.2 KiB
C
43 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* utils.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: whaffman <whaffman@student.codam.nl> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/06/16 12:43:53 by whaffman #+# #+# */
|
|
/* Updated: 2024/06/16 13:32:55 by whaffman ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include <unistd.h>
|
|
|
|
void put_n(int n)
|
|
{
|
|
char c;
|
|
|
|
c = n + '0';
|
|
write(1, &c, 1);
|
|
}
|
|
|
|
void display_grid(int **grid)
|
|
{
|
|
int x;
|
|
int y;
|
|
|
|
y = 0;
|
|
while (y < 4)
|
|
{
|
|
x = 0;
|
|
while (x < 4)
|
|
{
|
|
put_n(grid[y][x]);
|
|
if (x < 3)
|
|
write(1, " ", 1);
|
|
x++;
|
|
}
|
|
write(1, "\n", 1);
|
|
y++;
|
|
}
|
|
}
|