ticTacToeYourName
Create a project that is named: ticTacToeYourName.
In it, create one class named Main that will contain the main method.
The Main class will contain the entire tic tac toe program, but you can make more methods within it, if it makes sense to do so (they will all need to be static methods).
This game must use a 2D array. In order to incorporate both integers and characters, it will need to be an array of Strings.
Use ASCII art to draw the grid.
Ensure the players can play again if they want to.
The Program:
Here is the output your program should produce (minor changes to be creative are okay):
Player 1 enter your name:
Kyle
Player 2 enter your name:
Duncan
Kyle, press Enter to roll the die.
Kyle rolled a 5.
Duncan, press Enter to roll the die.
Duncan rolled a 4.
Kyle goes first.
Kyle, type 1 to choose x, 2 to choose o.
1
Kyle, you are x.
Duncan, you are o.
2_ | 3__4 |
---|---|
8_ | 9_ |
Kyles’s turn. Type in the number of the grid where you’d like to place your x:
8
2_ | 3__4 |
---|---|
x_ | 9_ |
Duncan’s turn. Type in the number of the grid where you’d like to place your o:
5
2_ | 3__4 |
---|---|
x_ | 9_ |
Kyle’s turn. Type in the number of the grid where you’d like to place your x:
7
2_ | 3__4 |
---|---|
x_ | 9_ |
Duncan’s turn. Type in the number of the grid where you’d like to place your 0:
4
2_ | 3__0 |
---|---|
x_ | 9_ |
Kyle’s turn. Type in the number of the grid where you’d like to place your x:
9
2_ | 3__0 |
---|---|
x_ | x_ |
Kyle WINS!!!
*************************************************************
Press 1 to play again, or 2 to end.
i don’t have time to do this
kinneyxdd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.