https://github.com/ormidales/java-tictactoe
This is a simple implementation of the Tic-Tac-Toe game in Java. It allows two players to play the game in the command line by taking turns entering the row and column where they want to place their mark.
https://github.com/ormidales/java-tictactoe
game java simple-game tic-tac-toe tictactoe
Last synced: 2 months ago
JSON representation
This is a simple implementation of the Tic-Tac-Toe game in Java. It allows two players to play the game in the command line by taking turns entering the row and column where they want to place their mark.
- Host: GitHub
- URL: https://github.com/ormidales/java-tictactoe
- Owner: Ormidales
- Created: 2022-12-03T16:46:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-04T19:28:18.000Z (over 2 years ago)
- Last Synced: 2025-01-13T07:25:31.719Z (4 months ago)
- Topics: game, java, simple-game, tic-tac-toe, tictactoe
- Language: Java
- Homepage: https://hugodoueil.fr
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tic-Tac-Toe in Java
This is a simple implementation of the Tic-Tac-Toe game in Java. It allows two players to play the game in the command line by taking turns entering the row and column where they want to place their mark. The game ends when one of the players wins or when the grid is full and no more moves can be made. The game checks for winning combinations in rows, columns, and diagonals, and prints the winner (if any) or a message indicating that the game ended in a tie.
## Usage
To run the game, clone the repository and compile the `TicTacToe.java` file with the following command:
```java
javac TicTacToe.java
```Then, run the compiled class file with the following command:
```java
java TicTacToe
```This will start the game and prompt the first player to enter their move. The players will take turns entering the row and column where they want to place their mark (X or O). The game will continue until someone wins or there are no more empty spaces on the grid.