Question
Tictactoe game in java using 2D array. Using no Scanner class. The program should allow a human to play tic-tac-toe against the computer. The human
Tictactoe game in java using 2D array. Using no Scanner class.
The program should allow a human to play tic-tac-toe against the computer.
The human always goes first and uses X as its symbol.
The computer always goes second and uses O as its symbol.
When it is the computer's turn to go, it chooses a square randomly. It might choose a square that is already occupied; if so, it keeps generating position choices until it finds an empty square.
If the user enters incorrect input, they get an error message and are prompted to try again.
When someone wins or ties, a message to this effect is printed out and the game is over.
Before each turn, the board is printed out, as well as a message saying whose turn it is.
in order to input a move, the user enters the number of the desired square. The squares should be numbered as shown to the right. A reference for the square numbering should always be on screen - this will make choosing a square easier.
Give the computer a better strategy than randomly choosing the square.
Change the program so two humans can play each other.
Change the program so the computer can play itself (a demo game).
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