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

https://github.com/nurulashraf/java-tic-tac-toe

A simple two-player console-based Tic-Tac-Toe game written in Java. Includes input validation, win detection, and a turn-based system. Players take turns entering their moves, and the game announces the winner or a draw. Ideal for beginners learning Java basics and game logic.
https://github.com/nurulashraf/java-tic-tac-toe

beginner-friendly command-line-game console-game game-development java tic-tac-toe two-player

Last synced: 10 months ago
JSON representation

A simple two-player console-based Tic-Tac-Toe game written in Java. Includes input validation, win detection, and a turn-based system. Players take turns entering their moves, and the game announces the winner or a draw. Ideal for beginners learning Java basics and game logic.

Awesome Lists containing this project

README

          

# Java Tic-Tac-Toe

A simple two-player console-based Tic-Tac-Toe game written in Java. The game includes input validation, win detection, and a turn-based system. Players take turns entering their moves, and the game announces the winner or a draw. Ideal for beginners learning Java basics and game logic.

## Features
- Two-player turn-based gameplay
- Input validation to prevent invalid moves
- Automatic win and draw detection
- Simple console-based UI

## Installation
1. Clone the repository:
```sh
git clone https://github.com/nurulashraf/java-tic-tac-toe.git
```
2. Navigate to the project directory:
```sh
cd java-tic-tac-toe
```
3. Compile the Java code:
```sh
javac src/TicTacToe.java
```
4. Run the game:
```sh
java -cp src tictactoe.TicTacToe
```

## Usage
- Run the program and follow the on-screen instructions.
- Players take turns inputting row and column numbers (0-2) to place their mark (`X` or `O`).
- The game will announce the winner or a draw when applicable.

## License
This project is licensed under the MIT License. See the `LICENSE` file for details.