Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.46 KB

File metadata and controls

46 lines (31 loc) · 1.46 KB

Welcome to Tic-Tac-Toe! This is a simple Python implementation of the classic Tic-Tac-Toe game for two players. Exolanation blog post https://dev.to/thevinudan/building-a-tic-tac-toe-game-in-python-a-step-by-step-guide-54ko

How to Play

  1. Setup: Player 1 is represented by 'X' and Player 2 by 'O'. The game is played on a 3x3 grid.

  2. Game Rules:

    • Players take turns to place their symbol on an empty cell of the grid.
    • The first player to align three of their symbols in a row, column, or diagonal wins.
    • If all cells are filled and no player has won, the game ends in a draw.
  3. Example: To place your symbol in the top-right corner, enter "3" when prompted.

  4. Game Controls:

    • Player 1: Enter position number (1 through 9) to place 'X'.
    • Player 2: Enter position number (1 through 9) to place 'O'.
  5. Getting Started: Run the Python script pmain.py to start the game.

Gameplay

  • The game starts with a welcome message and the initial state of the board is displayed.
  • Players take turns entering their moves until a player wins or the game ends in a draw.
  • The current state of the board is displayed after each move.

Requirements

  • Python 3.x

Usage

  1. Clone this repository:
    git clone https://github.com/ThevinuDan/Python-TIC-TAC-TOE.git
    cd Python-TIC-TAC-TOE
    
  2. Run the game:
    python pmain.py
    

Contributing

Contributions are welcome! Feel free to submit issues or pull requests.