Skip to main content

Orientation-independent Rubik cube model in strictly typed Python

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

rubik-cube-model

A Poetry-based Python package that models a Rubik's Cube using linked sticker objects and per-face clockwise adjacency mappings.

Highlights

  • Strict typing (mypy --strict)
  • Orientation-independent cube state
  • Color and Side are enums
  • CornerSticker objects form circular linked lists of size 3
  • EdgeSticker objects form circular linked lists of size 2
  • Cube.next_edge and Cube.next_corner encode clockwise sticker order on faces

Install

poetry install

Example

from rubik_cube_model import Color, Cube

cube = Cube.solved(front_color=Color.GREEN, top_color=Color.WHITE)
assert cube.home.color is Color.GREEN

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

rubik_model-1.0.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

rubik_model-1.0.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file rubik_model-1.0.0.tar.gz.

File metadata

  • Download URL: rubik_model-1.0.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for rubik_model-1.0.0.tar.gz
Algorithm Hash digest
SHA256 45cda6f2450bc46ba6e9cf2c0c0014febbc6a8ec56071845cefa8e46dae4c93d
MD5 f8d3e93a99072b5b25ead688e6b3a777
BLAKE2b-256 b08cbedf6de79da0ebb482aee84fb5c98fc49cf8b811009b29bcef8c7acbd102

See more details on using hashes here.

File details

Details for the file rubik_model-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: rubik_model-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for rubik_model-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34c49d1947d085d6f117007bcdf17defef7af8d42cf1839114ca80336077f182
MD5 d6e13e451d59bcd70c9e2b6b7789562f
BLAKE2b-256 cc9e610d403dd4aa0fa1fbf33dc46439cdb0d792d172c306cfd39ea696ea2d10

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