Question: Please help me! Program Specification: Write a Java program that playes a simple game of Tic-Tac-Toe: This is a two player (Xs and Os) board

Please help me!

Program Specification:

Write a Java program that playes a simple game of Tic-Tac-Toe:

This is a two player (Xs and Os) board game.

The game board is a 3 X 3 grid, where each location can hold either an X an O or space (empty) Note: we will linearize the grid and refer to its locations as 1 - 9, for conveyance.

The players take turns placing their mark into one of the (empty) locations in the grid.

The game is won when a player has their mark in all three locations of any row, column, or diagonal.

The game can also reach a stalemate: neither player has won (by above criteria) however there are no more empty locations in the grid. Requirement(s):

You must use an appropriate user-validation loop for all user input.

Hint(s):

Use nine char variables (initialized to ) to represent the 9 grid locations.

Keep track of the total number of moves, for an easy stalemate detection.

Your location choice user-validation loop must also not accept any location that is not currently empty.

At times things will feel very tedious - doing the same thing nine times ...

Please help me! Program Specification: Write a Java program that playes asimple game of Tic-Tac-Toe: This is a two player (Xs and Os)

Sample run(s): Welcone to Tic-Tac-Toe goea first Please enter location to nove [1-910 Please enter location to nove [1-9]:-1 Please enter location to nove [1-9] Please enter location to nove [1 9] :1 Please enter location to nove [1 -9]2 Please enter Location to nove 1 9] :3

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!