Skip to content

A simple two-player Tic Tac Toe game built using Java and the Swing library. Players alternate turns to place their symbol (X or O) on a 3x3 grid. The current player's turn is displayed, and the game automatically detects wins or draws.

Notifications You must be signed in to change notification settings

Ramlah7/Tic-Tac-Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9729c69 · Jan 20, 2025

History

3 Commits
Jan 20, 2025
Jan 20, 2025

Repository files navigation

Java Tic Tac Toe Game

A simple Tic Tac Toe game implemented in Java with a GUI. This game allows two players (Player X and Player O) to take turns and play on a 3x3 grid. The current player's turn is displayed, and the grid updates with an image for each player's move.

Features

  • Two-player mode (Player X and Player O).
  • A graphical user interface (GUI) with a 3x3 grid of buttons.
  • Displays current player's turn at the top.
  • Game automatically detects win or draw conditions.

How to Play

  1. Run the game.
  2. Player X starts by clicking any empty cell on the 3x3 grid.
  3. Player O then takes their turn by clicking an empty cell.
  4. The game alternates turns between Player X and Player O.
  5. The game ends when one player wins, or if all cells are filled resulting in a draw.

How to Run

  1. Clone the repository or download the files.

  2. Ensure you have Java installed on your machine (JDK 8 or higher).

  3. Compile the Java code:

    javac TicTacToe.java

About

A simple two-player Tic Tac Toe game built using Java and the Swing library. Players alternate turns to place their symbol (X or O) on a 3x3 grid. The current player's turn is displayed, and the game automatically detects wins or draws.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published