Like Tic Tac Toe, but form a square with 4 corners instead of a line
Project description
Square Tic Tac Toe
In Tic Tac Toe, a player wins by forming a line with three consecutive cells in any direction — horizontal, vertical or diagonal. In this modified version, a player has to form a square, i.e. four cells forming 90 degree angles and equidistant from each other.
A 3x3 grid would be too small a playing area, so 4x4 grid is used instead. Compared to 8 possible lines in Tic Tac Toe, this game has 20 possible squares. Can you spot all of them? Here's an illustration to help you:
Screenshot
Terminal dimension should be at least 84x25 (characters x lines) for the game widgets to appear properly. When you run the app, you should get an initial screen similar to the one shown below:
Guide
- Click the New Game button to start a new game. Existing game, if any, will be abandoned.
- You can choose between Easy (default) and Hard modes by clicking those buttons.
- In Easy mode, the AI will make the first move with a 50% chance and afterwards it will make a move randomly in response to user moves.
- In Hard mode, the AI will always make the first move and at best you'll be able to TIE the game ;)
- These choices will come into effect only after a new game is started.
- Press d key to toggle between light and dark themes.
- Press q key or Ctrl+c to quit the app.
User moves are denoted by the ⭕️ character and AI moves are denoted by the ✖️ character.
The text panel to the left of the game board displays the current status of the game. If the game ends with one of the players forming a valid square, the winning square will be highlighted.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file squaretictactoe-1.5.0.tar.gz
.
File metadata
- Download URL: squaretictactoe-1.5.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b9b718794ad82824a33ccc89d296075765123cebdad18577264b7966f6dec54 |
|
MD5 | 03ab773661e6c702655eaf5ce0b18471 |
|
BLAKE2b-256 | 95e303e948bd4e7e7f719cb88f001c096d421aaa9121240e8a73ad8edcb19f25 |
File details
Details for the file squaretictactoe-1.5.0-py3-none-any.whl
.
File metadata
- Download URL: squaretictactoe-1.5.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 144dcb59ad35ed24a172fde146ad00387b7c6270eaeb1737211b6b59650511e8 |
|
MD5 | ef7f782b7e98195acf112ec6eb634e6d |
|
BLAKE2b-256 | e96c540c85ffe04ca54fd1552111586e78fb8e9dd150f75c7c24d7b881349f96 |