- The game is played on a grid that's 3 squares by 3 squares.
- You are X, your friend (or the computer in this case) is O.
- Players take turns putting their marks in empty squares.
- The first player to get 3 of her marks in a row (up, down, across, or diagonally) is the winner.
- When all 9 squares are full, the game is over.
- Our Tic Tac Toe is programmed in other to allow two users or players to play the game in the same time.
- It is GUI game & gives an instant alert when players wins or losses or draw the game basically tells us to restart.
Libraries Required
Library | Command To Install | Documentation |
---|---|---|
Pygame | pip install pygame |
https://pypi.org/project/pygame/ |
Sys | pip install os-sys |
https://pypi.org/project/os-sys/ |
- First of all, create a folder named any in your PC & drag it to your code editor.
- Secondly, open your command prompt(CMD) & install the Pygame package by typing pip install pygame command and os-sys package by typing pip install os-sys .(I used windows10 OS)
- Thirdly, make a file called TicTacToeGame.py . It will you to store all your code needed for the game.
- Set your codes which are given below to your respective files.
- Lastly just run this code and enjoy the game.