Skip to main content

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:

Types of Squares

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:

Square Tic Tac Toe initial screen

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.

Metadata

Release files for squaretictactoe 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for squaretictactoe 1.6.0
File Size Uploaded Provenance
squaretictactoe-1.6.0.tar.gz 5.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for squaretictactoe 1.6.0
File Interpreter ABI Platform
squaretictactoe-1.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / squaretictactoe-1.6.0.tar.gz

Download URL squaretictactoe-1.6.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
99a4279fe21a0780f950b13adf97e7094516f03fcbaed8c0b22a4235df9644f4
BLAKE2b-256 checksum
How to use checksums
b1d37120f58f9828dd1318b797b1f662840bd37fc62f4288dc6a86e2b63e47c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.20

Release files / squaretictactoe-1.6.0-py3-none-any.whl

Download URL squaretictactoe-1.6.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4b904de9b2be64913b0a8d52d5f3adde53b8871870667e2c6eba19a40245494
BLAKE2b-256 checksum
How to use checksums
57049d08e5f43f57d27175d7f4bdf0b0dd66f39aa85cb7251d600eca32369b85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.20

Security for squaretictactoe 1.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page