I have the two methods below. In makeBoard am i calling the Boardfill method correctly? I don't really know much about pointers etc.
Code:
void Boardfill(Board * B)
{
int row, col;
Cell cell;
for(row=0; row<9; row++) {
for(col=0; col<9; col++) {
cell = B->board[row][col];
cell.visible = ' ';
cell.npossible = '9';
int k;
for(k=1; k<10; k++)
cell.possible[k] = '1';
}
}
}
Board makeBoard(Puzzle p)
{
Board b;
Boardfill(&b);
int row, col;
for(row=0; row<9; row++) {
for(col=0; col<9; col++) {
if(p[row][col] == ' ')
;
else
setvisible(&(b.board[row][col]), p[row][col]);
}
}
return b;
}