This is a simple Python program that lets two human players play a game of Tic Tac Toe directly in your terminal. The program guides players to take turns inputting their moves, displays a graphical representation of the game board, and reports the outcome once the game is over.
- Two-Player Game: Play a classic game of Tic Tac Toe with a friend.
- Terminal-Based Graphical Board: The board is displayed using ASCII art, with empty cells numbered for easy move selection.
- Turn-Based Input: Players take turns entering their moves.
- Outcome Reporting: The game automatically checks for a win or a draw after each move and announces the result.
- Python 3.x must be installed on your system.
- Clone or download this repository.
- Ensure the main script is named
tic-tac-toe.py
.
-
Open your terminal and navigate to the directory containing
tic-tac-toe.py
. -
Make the script executable by running:
chmod +x tic-tac-toe.py
-
Start the game by executing:
./tic-tac-toe.py
-
Follow the prompts to play
- Initial Board: When the game starts, you'll see a board with numbered positions corresponding to empty cells.
- Making a Move: Each player is prompted to enter a number (1-9) representing the cell where they want to place their mark.
- Winning the Game: The program checks after every move if a player has won (three marks in a row horizontally, vertically, or diagonally).
- Game Outcome: If a player wins, the program announces the winner. If all cells are filled with no winner, the program declares the game a draw.