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
-
Setup: Player 1 is represented by 'X' and Player 2 by 'O'. The game is played on a 3x3 grid.
-
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.
-
Example: To place your symbol in the top-right corner, enter "3" when prompted.
-
Game Controls:
- Player 1: Enter position number (1 through 9) to place 'X'.
- Player 2: Enter position number (1 through 9) to place 'O'.
-
Getting Started: Run the Python script
pmain.py
to start the game.
- 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.
- Python 3.x
- Clone this repository:
git clone https://github.com/ThevinuDan/Python-TIC-TAC-TOE.git cd Python-TIC-TAC-TOE
- Run the game:
python pmain.py
Contributions are welcome! Feel free to submit issues or pull requests.