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.
- Host: GitHub
- URL: https://github.com/alphacrypto246/tic-tak-toe
- Owner: alphacrypto246
- Created: 2023-04-22T19:14:49.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-06T09:28:51.000Z (7 months ago)
- Last Synced: 2025-02-10T12:15:32.217Z (5 months ago)
- Topics: java
- Language: Java
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.