This is a simple implementation of the classic Tic Tac Toe game using Python and the Pygame library. The game features a graphical interface and allows two players to take turns placing their symbols on a 3x3 grid. The game ends when one player gets three in a row or when the board is full, resulting in a tie.
Make sure you have Python installed on your machine. You can download Python from python.org.
To run the game, you need to install the Pygame library. You can install it using the following command:
pip install pygame
Execute the tic_tac_toe.py
script to start the game:
python tic_tac_toe.py
- The game starts with a random player, either 'Crosses' or 'Circles'.
- Players take turns clicking on an empty cell to place their symbol.
- The game ends when one player gets three in a row horizontally, vertically, or diagonally.
- If all cells are filled and no player has won, the game is a tie.
- Dark and light color themes (selectable in the script).
- On-hover highlighting of empty cells.
- Simple scoring system to keep track of wins for 'Crosses' and 'Circles'.
- Press 'R' to restart the game during play.
- Press 'Esc' to exit the game.
The game provides two color themes:
- Background: Dark Gray
- Line Color: Cream
- Cross Color: Red
- Cross Ghost Color: Light Red
- Circle Color: Lime
- Circle Ghost Color: Light Lime
- On-hover Color: Light Gray
- Background: Cream
- Line Color: Black
- Cross Color: Red
- Cross Ghost Color: Light Red
- Circle Color: Lime
- Circle Ghost Color: Light Lime
- On-hover Color: Dark Cream
Feel free to customize the color styles in the script according to your preferences.
Enjoy playing Tic Tac Toe!
this README was made with the help of ChatGPT.