This project is a simple yet fully functional Tic-Tac-Toe game built using Java and Swing for the graphical user interface (GUI). The game is designed for two players, taking turns to mark their respective symbols (X or O) on a 3x3 grid. The objective is to be the first player to get three of their marks in a horizontal, vertical, or diagonal row. In the case where all nine squares are filled without a winner, the game ends in a tie.
Here are some screenshots of the game:
- User-Friendly Interface: A clean and intuitive GUI using Java Swing for an engaging gameplay experience.
- Two-Player Mode: Players take turns to mark 'X' or 'O' on the board.
- Dynamic Gameplay: Automatically switches turns between players and updates the game status.
- Winning Conditions: The game checks for winning combinations horizontally, vertically, and diagonally.
- Tie Detection: Declares a tie when all nine squares are filled without a winner.
- Clone this repository:
git clone https://github.com/Aastha-Bhatia/Tic-Tac-Toe-Game.git
- Navigate to the project directory:
cd Tic-Tac-Toe-Game/TicTacToe/TicTacToe/src
- Compile the Java files:
javac App.java
- Run the application:
java App
- Start the Game: Launch the application to open the Tic-Tac-Toe board.
- Gameplay: Players take turns clicking on empty tiles to place their marks (X or O).
- Winning the Game: The game will highlight the winning combination and display the winner.
- Game Over: If the board is full without a winner, the game declares a tie.
This project is licensed under the MIT License. See the LICENSE file for more details.
- Java & Swing: For providing the framework to build the game's GUI.
- Inspiration: Classic Tic-Tac-Toe games.
Aastha Bhatia
Thanks to Kenny YiP Coding for the tutorials that helped me learn and build this game.
Connect with me on LinkedIn.
Feel free to contribute, provide feedback, or ask any questions! Enjoy playing the game!