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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started