/tictaktoe

Primary LanguagePythonMIT LicenseMIT

tictactoe

Tic-tac-toe is played on a three-by-three grid by two players, who alternately place the marks X and O in one of the nine spaces in the grid. The objective of the game is to get three of your symbols in a row, either horizontally, vertically, or diagonally, before your opponent does.

HOW TO PLAY THIS GAME?

Here's a step-by-step guide on how to play Tic-Tac-Toe:

  1. The game begins with an empty 3x3 grid.
  2. Two players take turns, usually one playing as "X" and the other as "O."
  3. The first player places their symbol in an empty cell on the grid.
  4. The second player then places their symbol in a different empty cell.
  5. The players continue taking turns until one of the following conditions is met: 5.1. A player gets three of their symbols in a row (horizontally, vertically, or diagonally), resulting in a win. 5.2. All the cells on the grid are filled, resulting in a tie or draw.
  6. If a player gets three of their symbols in a row, they win the game. If all the cells are filled and no player has won, the game is a tie. To make a move, you need to specify the position on the grid where you want to place your symbol. This is usually done by using numbers 1 to 9 to represent the different cells on the grid, as shown in the given screenshots.

Images/Samples

Image 1

Image 1

Image 2

Image 2

Image 3

Image 3

Image 4

Image 4

Image 5

Image 5

How to execute?

  1. Execute tictactoe.py file in any IDE.
  2. Press 1 to start the game.
  3. Now first player will choose the grid position to play a move with sign "X".
  4. Now second player will play his move and the game will move on as per the above rules.

List of contributors

  1. Priya Chaudhary
  2. Kaushal Diswar
  3. Ankit Kumar Singh
  4. Prachi Diswar