Game board

Hello everyone.

I need help creating a game board that is 7X6. How would I make the array so that the game board prints the way I want it to?


Thanks.
You need to declare a two dimensional array similar to

type myArray[rows][cols];

You can also do it such as

1
2
3
4
5
char ticTacToe[3][3] = { 
     { 'x', 'x', 'x' },
     {'o', 'o', 'o' },
     {'x', 'o', 'x' },
}


As an example of initializing values when you declare the array.

To print it out appropriately, you'll need to nest for loops.
One loop would iterate through the rows, the other would iterate through the columns.

Might want to look at
http://www.fredosaurus.com/notes-cpp/arrayptr/22twodim.html
http://www.learncpp.com/cpp-tutorial/65-multidimensional-arrays

For more in depth information.
Topic archived. No new replies allowed.