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.
- Host: GitHub
- URL: https://github.com/nurulashraf/java-tic-tac-toe
- Owner: nurulashraf
- License: mit
- Created: 2025-02-04T07:09:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-04T07:11:50.000Z (over 1 year ago)
- Last Synced: 2025-02-12T09:55:00.695Z (over 1 year ago)
- Topics: beginner-friendly, command-line-game, console-game, game-development, java, tic-tac-toe, two-player
- Language: Java
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.