Skip to content

Mamir21/TicTacToe-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe Game

This is a simple implementation of the classic Tic Tac Toe game in Java. The game allows two players to take turns marking spaces on a 3x3 grid with the goal of getting three marks in a row, column, or diagonal.

Features

  • Two-Player Mode: Play against a friend on the same computer.
  • Interactive Interface: Easily mark your moves and see the updated board.
  • Win Detection: Automatically detects when a player wins or the game ends in a draw.
  • Restart Option: Choose to play again after a game is over.

Getting Started

Installation

  1. Clone the Repository:
    git clone https://github.com/your-username/tic-tac-toe.git
    
  2. Navigate to the project directory:
    cd tic-tac-toe
    
  3. Compile the Code:
    javac TicTacToe.java
    
  4. Run the Game:
    java TicTacToe
    

How to Play

  1. The game starts with an empty 3x3 grid.
  2. Player 1 (X) goes first, followed by Player 2 (O).
  3. Players take turns marking an empty space on the grid with their symbol.
  4. The first player to get three of their symbols in a row, column, or diagonal wins.
  5. If all spaces are filled and no player has three in a row, the game ends in a draw.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors