-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint_entire_board.c
63 lines (57 loc) · 1.08 KB
/
print_entire_board.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <unistd.h>
//Function declarations
void ft_putchar(char c);
void ft_putstr(char *c);
//Declare struct here
struct solve_state
{
int board[10][9][9];
int views[9][4];
int N;
int x;
int y;
int z;
};
//Function to print our the entire board array
void print_entire_board(struct solve_state current)
{
int x;
int y;
int z;
x = 0;
y = 0;
z = 0;
while (z < current.N) // goes through every row
{
y = 0;
while (y < current.N)
{
x = 0;
while (x < current.N)
{
ft_putchar(' ');
ft_putchar(current.board[z][y][x] + '0');
x++;
}
y++;
}
ft_putchar('\n');
z++;
}
}
/*
void print_views(struct solve_state current)
{
int x = 0;
int y = 0;
while (y < current.N) {
x = 0;
while (x < current.N) {
ft_putchar(current.views[y][x] + '0');
ft_putchar(' ');
x++;
}
ft_putchar('\n');
y++;
}
}*/