This is a simple command-line implementation of the classic Tic Tac Toe game in Python. The game allows a player to play against the computer and follows the standard rules of Tic Tac Toe.
- Run the
Tic-Tac-Toe.py
script to start the game. - And add two files
Grid.py
&Toss.py
as they are further used to import functionality as module's which are used for creating grid and making toss. - The game will prompt the player to enter their name and choose a symbol (either 'X' or 'O').
- A toss will decide which player goes first - the player or the computer.
- Players will take turns making their moves by entering the number corresponding to the cell they want to place their symbol.
- The first player to get three of their symbols in a row (horizontally, vertically, or diagonally) wins the game.
- If all cells are filled, and no player has won, the game is declared a draw.
- The game offers a simple and easy-to-use command-line interface.
- The computer AI tries to make smart moves and counter the player's moves when possible.
- The game board is displayed after every move to keep track of the game progress.
- Players can choose their symbol ('X' or 'O').
- Python 3.11.4
- Clone or download this repository to your local machine.
- Open the terminal or command prompt and navigate to the folder containing the downloaded files.
- Run the following command to start the game:
python Tic-Tac-Toe.py
Tic-Tac-Toe.py
(The actual game this file will be runned).Grid.py
(Module used to import grid which will be further printed).Toss.py
(Module used to import toss making so first move can be decided between (Computer & User)).- Note:
Add two files
Grid.py
&Toss.py
as they are further used to import functionality as module's which are used for creating grid and making toss.
This Tic Tac Toe game was created by Mohammed Ahsan Wakir (FA22-BCT-001) and Abdullah (FA22-BCT-004) as a project for their computer programming course.
We welcome contributions to this project! If you find any bugs, have suggestions for improvements, or want to add new features, please feel free to create issues or submit pull requests.
This project is licensed by MIT license.
For any inquiries or support, please contact Abdullah at abdullahmaqbool08@gmail.com.
Enjoy playing Tic Tac Toe! 🎉🎮