This is a simple implementation of the classic Tic Tac Toe game in Java. The game allows two players to take turns marking spaces on a 3x3 grid with the goal of getting three marks in a row, column, or diagonal.
- Two-Player Mode: Play against a friend on the same computer.
- Interactive Interface: Easily mark your moves and see the updated board.
- Win Detection: Automatically detects when a player wins or the game ends in a draw.
- Restart Option: Choose to play again after a game is over.
- Java Development Kit (JDK): Ensure you have JDK installed on your computer. You can download it from the official Oracle website or use OpenJDK.
- Clone the Repository:
git clone https://github.com/your-username/tic-tac-toe.git
- Navigate to the project directory:
cd tic-tac-toe - Compile the Code:
javac TicTacToe.java
- Run the Game:
java TicTacToe
- The game starts with an empty 3x3 grid.
- Player 1 (X) goes first, followed by Player 2 (O).
- Players take turns marking an empty space on the grid with their symbol.
- The first player to get three of their symbols in a row, column, or diagonal wins.
- If all spaces are filled and no player has three in a row, the game ends in a draw.
This project is licensed under the MIT License - see the LICENSE file for details.