This is a simple implementation of the classic Tic Tac Toe game in Java using the Java programming language. The game is played on a 3x3 grid where two players, X and O, take turns marking the grid with their respective symbols. The first player to get 3 of their marks in a row (horizontally, vertically, or diagonally) wins the game. If all 9 squares are filled and there is no winner, the game is a draw.
- Java 8 or higher
- A Java development environment such as Eclipse or IntelliJ
- Clone or download the repository to your local machine
- Open the project in your Java development environment
- Run the main class
- Follow the on-screen instructions to play the game
The code consists of the following classes and functions:
- The main class(src -> main) that contains the main function. It manages the overall flow of the game, asking the user whether they want to play the game or exit.
- The Game function sets up the game, displays the game instructions, and handles the game play.
- The check function checks if any player has won the game.
- The XOGamePass function displays the current state of the game board.
- The game is only for two players and does not support more players.
- The game does not have an AI component to play against the computer.
If you find any bugs or have suggestions for improvements, feel free to open an issue or make a pull request.
This Tic Tac Toe game is a simple implementation of the classic game in Java. It provides a basic understanding of how the game works and how it can be implemented using the Java programming language. Feel free to use the code as a starting point for your own Tic Tac Toe game or as a learning tool for Java programming.