An open API service indexing awesome lists of open source software.

https://github.com/alphacrypto246/tic-tak-toe

The Tic-Tac-Toe project is a simple Java implementation of the classic 2-player game, where players take turns marking a 3x3 grid with 'X' and 'O'. The game checks for win conditions and ties.
https://github.com/alphacrypto246/tic-tak-toe

java

Last synced: 3 months ago
JSON representation

The Tic-Tac-Toe project is a simple Java implementation of the classic 2-player game, where players take turns marking a 3x3 grid with 'X' and 'O'. The game checks for win conditions and ties.

Awesome Lists containing this project

README

        

# Tic-Tac-Toe Game

A simple implementation of the classic Tic-Tac-Toe game in Java. This game allows two players to play the game on a 3x3 grid, where they take turns marking spaces with 'X' and 'O'. The first player to align three of their marks vertically, horizontally, or diagonally wins the game.

## Features

- **2-player gameplay**: Players take turns to place 'X' and 'O'.
- **Board display**: The board is printed after each move to show the current state.
- **Win conditions**: The game checks for win conditions (horizontal, vertical, diagonal).
- **Tie detection**: The game detects a tie if the board is full without a winner.

## Technologies Used

- **Java**: The programming language used for implementing the game logic and user interface.

## How to Play

1. Clone or download the repository.
2. Compile and run the `TickTakToe.java` file in any Java IDE or from the command line.
3. The game will prompt each player to enter a number (1-9) corresponding to a cell on the grid.
4. The game alternates turns between Player 1 (X) and Player 2 (O).
5. The game ends when a player wins or all cells are filled (tie).

## How to Run

1. Clone the repository:

```bash
git clone https://github.com/alphacrypto246/Tic-Tak-Toe.git
```

2. Compile the Java program:

```bash
javac TickTakToe.java
```

3. Run the compiled Java program:

```bash
java TickTakToe
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.