Skip to main content

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:

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.

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

squaretictactoe-1.6.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

squaretictactoe-1.6.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file squaretictactoe-1.6.0.tar.gz.

File metadata

  • Download URL: squaretictactoe-1.6.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for squaretictactoe-1.6.0.tar.gz
Algorithm Hash digest
SHA256 99a4279fe21a0780f950b13adf97e7094516f03fcbaed8c0b22a4235df9644f4
MD5 83d017eed9bf56b401fcd30f05402d27
BLAKE2b-256 b1d37120f58f9828dd1318b797b1f662840bd37fc62f4288dc6a86e2b63e47c5

See more details on using hashes here.

File details

Details for the file squaretictactoe-1.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for squaretictactoe-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4b904de9b2be64913b0a8d52d5f3adde53b8871870667e2c6eba19a40245494
MD5 babe2f20aaa131dfa34e5cf4ab8b6f8e
BLAKE2b-256 57049d08e5f43f57d27175d7f4bdf0b0dd66f39aa85cb7251d600eca32369b85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page