Ensure that your main class is com.tw.step8.ttt.Main
. Tests are expected to be written. The folder structure should be standard with src in src
and tests in test
. Do not use any libraries other than JUnit.
Implement the tic tac toe game.
The game keeps displaying the tic tac toe board, giving instructions, and taking in player’s move in a loop until the game finishes with the game ending in a draw or with one of the players winning.
java -jar ttt.jar Ramesh Suresh
---------------------
Ramesh:x Suresh:o
1 2 3
4 5 6
7 8 9
Ramesh's turn. Please enter the cell number > 1
---------------------
Ramesh:x Suresh:o
x 2 3
4 5 6
7 8 9
Suresh's turn. Please enter the cell number > A
*ERROR* Invalid Cell A, Please provide a vacant cell between 1-9
Suresh's turn. Please enter the cell number > 1
*ERROR* Cell 1 is Not Vacant, Please provide a vacant cell between 1-9
Suresh's turn. Please enter the cell number > 2
---------------------
Ramesh:x Suresh:o
x o 3
4 5 6
7 8 9
Ramesh's turn. Please enter the cell number >
~~ and so on till the game finishes ~~
---------------------
Ramesh:x Suresh:o
x o x
o x o
x o x
Ramesh wins
---------------------
Ramesh:x Suresh:o
x o o
x o x
o x x
Game ended in a Draw