This is a simple Java-based implementation of the Tic-Tac-Toe game, designed to play with AI. Game declares a winner or a draw at the end.
- Win against computer in simple Tic-Tac-Toe.
- Play Tic-Tac-Toe with AI
- Console-based interface
-
Download latest package
tictactoe-*-SNAPSHOT.jar
file from release [https://github.com/Jitendra1mp4/tic-tac-toe/releases] -
run jar file with
java -jar tictactoe-*-SNAPSHOT.jar
(make sure you have java version 11 or higher)
-
To be first player press 1 otherwise 0.
-
The game board is represented as a 3x3 grid, with positions numbered 1 to 9:
1 | 2 | 3 --------- 4 | 5 | 6 --------- 7 | 8 | 9
-
On your turn, select an empty position by entering the corresponding number (1–9).
-
For example if you enter
4
game will look like this :- - - X - - - - -
-
The game will check for a winner or a draw after each turn. Continue until the game ends.
This project is open-source and available under the MIT License.