I have an assignment I need to complete, where I get some data from a file and then have the output as a tic tac toe board.
On the file, it'll have something like
1 2 3
X O .
. . .
. . X
The '.' means that the spaces are blank.
I need to write a funtion to display a tic tac toe board on the screen.
1 2 3 4 5
I would just like some help starting the program. I don't know where to even begin. I need to get the file. After that i dont even know where to begin. Can someone help me out? Just a push in the right direction would be nice.
There are many threads about tic tac toe. I think you should search relevant threads by means of using keywords tic tac toe in this forum.
As for reading the file then you should decide either you will read data in a one-dimensional array of size equal to 9 or a two-dimensional array of size 3 x 3.
If all records of the file have exactly three fields then you can use operator >>.Otherwise you can use function getline.