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

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.

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.