so the line of code below gives me the output of:
- 2|3|-4
- -3|-2|-1
- 8|-7|95
Can anyone see what I ve done wrong? Thank you.
void init(void)
{
for (int i = 0; i < d; i++)
{
for (int j = 0; j < d; j++)
{
board[i][j] = d^2 - i*d - j - 1;
if (i + 1 == d && j + 1 == d)
board[i][j] = 95;
}
}
if ((d^2 - 1) % 2 != 0)
{
int temp = board[d-1][d-2];
board[d-1][d-2] = board[d-1][d-3];
board[d-1][d-3] = temp;
}
}