Could anyone help to have a look at my code? I ran check50 and it works for 3x3 but 4x4. However, when I checked manually with 4x4, it works.
Here is my code (won):
bool won(void)
{
int win_board = 1;
for(int i = 0; i < d; i++)
{
for(int j = 0; j < d && win_board < d*d; j++)
{
if(board[i][j] != win_board)
{
return false;
}
win_board++;
}
}
return true;
}
Check50 result: :) 3x3 board: make sure game is winnable :( 4x4 board: make sure game is winnable did not find output "1-2-3-4|5-6-7-8..."
I look further at the result of 4x4, it shows: "checking for output "1-2-3-4|5-6-7-8|9-10-11-12|13-14-15-0"... "