A Java based Tic Tac Toe Console based game.
To run this game, please execute the Main class which will initialize the game.
The player placing "crosses" (X) has won
-------------------
| 0,0 | 0,1 | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 0,0
-------------------
| x | 0,1 | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 0,1
-------------------
| x | o | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 1,1
-------------------
| x | o | 0,2 |
-------------------
| 1,0 | x | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 0,2
-------------------
| x | o | o |
-------------------
| 1,0 | x | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 2,2
-------------------
| x | o | o |
-------------------
| 1,0 | x | 1,2 |
-------------------
| 2,0 | 2,1 | x |
-------------------
Player x wins the game!
The player placing "crosses" (O) has won
-------------------
| 0,0 | 0,1 | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 0,0
-------------------
| x | 0,1 | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 0,1
-------------------
| x | o | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 1,0
-------------------
| x | o | 0,2 |
-------------------
| x | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 1,1
-------------------
| x | o | 0,2 |
-------------------
| x | o | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 2,2
-------------------
| x | o | 0,2 |
-------------------
| x | o | 1,2 |
-------------------
| 2,0 | 2,1 | x |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 2,1
-------------------
| x | o | 0,2 |
-------------------
| x | o | 1,2 |
-------------------
| 2,0 | o | x |
-------------------
Player o wins the game!
The outcome of the game is yet to be decided - Draw.
-------------------
| 0,0 | 0,1 | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 0,0
-------------------
| x | 0,1 | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 0,1
-------------------
| x | o | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 0,2
-------------------
| x | o | x |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 1,0
-------------------
| x | o | x |
-------------------
| o | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 1,2
-------------------
| x | o | x |
-------------------
| o | 1,1 | x |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 2,2
-------------------
| x | o | x |
-------------------
| o | 1,1 | x |
-------------------
| 2,0 | 2,1 | o |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 2,1
-------------------
| x | o | x |
-------------------
| o | 1,1 | x |
-------------------
| 2,0 | x | o |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 1,1
-------------------
| x | o | x |
-------------------
| o | o | x |
-------------------
| 2,0 | x | o |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 2,0
-------------------
| x | o | x |
-------------------
| o | o | x |
-------------------
| x | x | o |
-------------------
We have a draw!
Valid coordinate input check
- Bound Check
- Coordinate expression check
-------------------
| 0,0 | 0,1 | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 0,1
-------------------
| 0,0 | x | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 0,2
-------------------
| 0,0 | x | o |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 0,3
Please enter a valid coordinate
-------------------
| 0,0 | x | o |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 0.5
Please enter a valid coordinate
-------------------
| 0,0 | x | o |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: fafa
Please enter a valid coordinate
-------------------
| 0,0 | x | o |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: -,-
Please enter a valid coordinate
-------------------
| 0,0 | x | o |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark:
Cell value validation - Not Empty
-------------------
| 0,0 | 0,1 | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 0,0
-------------------
| x | 0,1 | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | 2,2 |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 2,2
-------------------
| x | 0,1 | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | o |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 2,2
That cell has already been taken, please choose another cell
-------------------
| x | 0,1 | 0,2 |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | o |
-------------------
Player ' x ' input the coordinate where you want to place your mark: 0,2
-------------------
| x | 0,1 | x |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | o |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 0,2
That cell has already been taken, please choose another cell
-------------------
| x | 0,1 | x |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| 2,0 | 2,1 | o |
-------------------
Player ' o ' input the coordinate where you want to place your mark: 2,0
-------------------
| x | 0,1 | x |
-------------------
| 1,0 | 1,1 | 1,2 |
-------------------
| o | 2,1 | o |
-------------------
Player ' x ' input the coordinate where you want to place your mark:
Harkrishen Singh Matta