Question: usign C++ Write a function to read a Tic-Tac-Toe board into an array. The file format is: X O . . . . . X

usign C++

Write a function to read a Tic-Tac-Toe board into an array. The file format is:

X O . . . . . X . 

The character 'X' means that the 'X' player has taken that square. The character '.' means that the square is currently unclaimed. There is one space between each symbol.

Note: You will need to store the results in a 2D array. The function should take the filename as a parameter.

Write a function to display a Tic-Tac-Toe board on the screen. Given the above board, the output is:

 X | O | ---+---+--- | | ---+---+--- | X | 

Write a function to write the board to a file. The file format is the same as with the read function.

Example

The user input is underlined.

 Enter source filename: board.txt X | O | ---+---+--- | | ---+---+--- | X | Enter destination filename: board2.txt File written 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!