Any array or 'board' that is 9 by 9. It's not 8 by 8 because the array starts at [0][0].
Code:
for ( x = 0; x < 8; x++ ) {
for ( y = 0; y < 8; y++ )
array[x][y] = x * y; // Set each element to a value
}
This is the method of giving each part of the array it's own value so if you built the array the order the values assign would look like this because for each time that x loops y will loop 8 times. Each [] representing an element in the array
Code:
[1] [10] [19] [] [] [] [] []
[2] [11] [20] [] [] [] [] []
[3] [12] [21] [] [] [] [] []
[4] [13] [] [] [] [] [] []
[5] [14] [] [] [] [] [] []
[6] [15] [] [] [] [] [] []
[7] [16] [] [] [] [] [] []
[8] [17] [] [] [] [] [] []
[9] [18] [] [] [] [] [] []
It would go on to fill the rest of the elements but keep in mind those numbers aren't actually stored in the array but they are there to demonstrate the order in which the for loop gives each [] a value. Each array element is set to x*y and the x and y values depend on how far the for loops have gone through their cycle.
Code:
cout<<"Array Indices:\n";
for ( x = 0; x < 8;x++ ) {
for ( y = 0; y < 8; y++ )
cout<<"["<<x<<"]["<<y<<"]="<< array[x][y] <<" ";
cout<<"\n";
}
This just goes back through and outputs the numbers previously stored in the array.