Skip to main content

Describe the cycles on a scrambled Rubik's Cube

Project description

dlin-tracer

Describe piece cycles on a Rubik's Cube.

Usage: As a Python Package

If you would like to use the tracer as a python package, please follow the following instructions.

Installing

To install, run

pip install dlin

Using

The dlin.tracer function converts a scramble (set of moves defined by WCA regulation 12a separated by spaces) into a python dictionary describing cycles on the cube.

To use, run

from dlin import tracer

The following is example code to get the tracing for a scramble.

described_cycles = tracer("F' L2 B2 F2 D' F2 D F2 U R2 U' L' B L' R' F2 R2 B2 U2 Fw'")

Here is an example of what could be contained in described_cycles

{
    "edge": [
        {
            "type": "cycle",
            "buffer": "UF",
            "targets": ["LD", "LF", "RU", "LU"],
            "orientation": 0,
            "parity": 0,
        },
        {
            "type": "cycle",
            "buffer": "UB",
            "targets": ["RB", "DR"],
            "orientation": 1,
            "parity": 0,
        },
        {
            "type": "cycle",
            "buffer": "FR",
            "targets": ["DB", "DF"],
            "orientation": 1,
            "parity": 0,
        },
    ],
    "corner": [
        {
            "type": "cycle",
            "buffer": "UFR",
            "targets": ["UBL", "RUB", "RDB", "FDR", "UFL", "FDL"],
            "orientation": 1,
            "parity": 0,
        },
        {
            "type": "misoriented",
            "location": "DBL",
            "targets": [],
            "orientation": -1,
            "parity": 0,
        },
    ],
    "scramble": "F' L2 B2 F2 D' F2 D F2 U R2 U' L' B L' R' F2 R2 B2 U2 Fw'",
    "rotation": ["z"],
}

Usage: Command Line Script

Run dlin-trace [scramble] Make sure to surround the scramble in quotation marks. This will output a json, with similar structure to the dictionary shown above.

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

dlin-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

dlin-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file dlin-0.1.0.tar.gz.

File metadata

  • Download URL: dlin-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for dlin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 14c3236a935e43b8800441d4c59e271fab9594747988f24ef3a7146189504129
MD5 66c5eb52ba6e6befa6f46d0d1a0f1e53
BLAKE2b-256 0ce5689675dd67f65e52149b42f12fb21d33fbfd55cbfdee8d091712633895ce

See more details on using hashes here.

File details

Details for the file dlin-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dlin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for dlin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a17e2d8db796636f237ea7a6a16e166e01ed8ed489d0d14259568427e748283a
MD5 ef5985e2c8dd4a2f4e95e6b54e62e6a9
BLAKE2b-256 148dea47a49f746ca19b6e04528e7b374ef9b9c216e0f0fd8b08ce96ec6d14be

See more details on using hashes here.

Supported by

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