Skip to content

Files

Latest commit

 

History

History

Tanushree713

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Tic-Tac-Toe Game (2 Players)

Table of Contents


Introduction

Welcome to the 2-player Tic-Tac-Toe game! This classic game is designed for two players to compete against each other in a simple yet engaging way. It's a perfect choice for those who enjoy strategic thinking and friendly competition.

Game Rules

Tic-Tac-Toe is played on a 3x3 grid. Two players take turns marking empty cells with their respective symbols:

  • Player 1: O
  • Player 2: X

The goal of the game is to form a straight line (horizontal, vertical, or diagonal) of your symbol (X or O) before your opponent does. The player who achieves this first wins the game.

Getting Started

To play the game, follow these steps:

  1. Clone this repository to your local machine or download the source code.
  2. Open a terminal or command prompt and navigate to the game's directory.

How to Play

  1. Run the game by executing the main script. For example, if you are using Python, you can run the game with the following command:
    python tictactoe.py
    
  2. The game will display an empty 3x3 grid.
  3. Players will take turns entering the row and column where they want to place their symbol (X or O).
  4. The game will update the grid and display it after each move.
  5. Continue taking turns until one player wins or the game ends in a draw.

Winning

A player wins by achieving one of the following conditions:

  • Completing a row (horizontally).
  • Completing a column (vertically).
  • Completing a diagonal line (either from the top-left to bottom-right or from top-right to bottom-left).

The game will announce the winner and ask if you want to play again.

Draw

If all cells on the grid are filled, and no player has achieved a winning condition, the game ends in a draw. It will inform you that the game is a draw and ask if you want to play again.

Contributing

If you'd like to contribute to this Tic-Tac-Toe game, please feel free to submit pull requests or open issues on the GitHub repository. We welcome any improvements, bug fixes, or feature enhancements.

License

This Tic-Tac-Toe game is open-source software released under the MIT License. You are free to use, modify, and distribute this software as per the terms of the license.

Enjoy playing the game and have fun competing with your friends!