Attached Files:
- Main.java (2.306 KB)
Write a program to play the game Tic-Tac-Toe, using arrays andmethods. It should play a one-player game, between the computer(program) and the player (user). Think about how the gameworks.
- The game can begin by displaying the game board, such as:
0|1|2
—–
3|4|5
—–
6|7|8 - The player can make moves by specifying the number of theposition.
- After each move, both player or program, the game board isdisplayed again, with X’s and O’s in the correct place (instead ofnumbers).
- When the program has its turn, it will follow the strategy:(for multiple positive checks, have the program respond to thefirst)
- First, check if a win is possible
OROR
- First, check if a win is possible