Skip to content

ariafanyang/Tic-Tac-Toe-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tic tac toe game

Game Rules

Tic-Tac-Toe is a simple two-player game played on a 3x3 grid. The objective is to be the first player to align three of your symbols in a row, column, or diagonal.

Symbols

  • Players can choose their symbol: Players are prompted to choose whether they want to be X or O at the start of the game.

Winning Conditions

  • A player wins if they manage to align three of their symbols in any of the following ways:
    1. Horizontally: All three squares in a single row.
    2. Vertically: All three squares in a single column.
    3. Diagonally: All three squares in either diagonal.

If all 9 squares are filled without any player achieving alignment, the game ends in a tie.

How to Play

  1. Starting the Game:
  • You will be prompted to enter your name and choose whether you want to be X or O.
  1. Single Player Modes:

    • You can choose to play against:
      • A dumb computer that makes random moves.
      • An intelligent computer that blocks potential winning moves and tries to win.
  2. Making a Move:

    • The game displays the 3x3 board with empty squares.
    • Enter the row and column numbers (0, 1, or 2) to place your symbol in the desired square.
    • Example: Entering 1 for the row and 2 for the column places your symbol in the middle-right square.
  3. Taking Turns:

    • Players alternate turns until one player wins or the board is full.
    • If you’re playing against the computer, it will make its move automatically after you make yours.
  4. Ending the Game:

    • The game ends when one player aligns three symbols or the board is completely filled (tie).
    • The scoreboard is updated to reflect the outcome (win, lose, or tie).
    • You can choose to play another round or exit.

Tips

  • Choose your symbol wisely! Sometimes, picking the second turn can offer strategic advantages.
  • Try to occupy the center square whenever possible; it increases your chances of winning.
  • Block your opponent's potential winning moves whenever you spot them.

Enjoy the game and have fun!

About

Tic Tac Toe Game in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published