Skip to content

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.

Notifications You must be signed in to change notification settings

Ormidales/JAVA-TicTacToe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

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:

javac TicTacToe.java

Then, run the compiled class file with the following command:

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.

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages