Skip to main content

Rubik solver algorithms

Project description

How to install

$ pip install solvecube

How to use

As a command

docs/_static/cmd_tty.gif

As a module

>>> cube = 'wowgybwyogygybyoggrowbrgywrborwggybrbwororbwborgowryby'
>>> from solvecube import utils
>>> utils.solve(cube, 'Beginner')
[F', R, U', R', U, U, F2, Y, B', U, B, U, F2, Y, R', F', U, F, R, U, U, U, F2, Y, L, F, U', F', L', U, F2, Y, L', U, L, U', R, U, R', Y, U', F', U', F, Y, B, U, B', R, U, R', Y, Y, U', L', U, L, U, F, U', F', Y, Y, U2, Y2, U, R, U', R', U', F', U, F, Y, Y, U, R, U', R', U', F', U, F, Y, F, R, U, R', U', F', U2, F, R, U, R', U', F', F, R, U, R', U', F', U, U, U, U, R, U', L', U, R', U', L, R', D', R, D, R', D', R, D, U, R', D', R, D, R', D', R, D, U, U, R', D', R, D, R', D', R, D, U]
>>> utils.solve(cube, 'CFOP')
[F', R, U', R', U, U, F2, Y, B', U, B, U, F2, Y, R', F', U, F, R, U, U, U, F2, Y, L, F, U', F', L', U, F2, Y, L', U, L, U', U, F', U, F, U, F', U2, F, Y, U, Y', R', U', R, U2, R', U', R, U, R', U', R, Y, Y, B, U, B', U, F', U2, F, U, F', U2, F, Y, U2, U', R, U, R', U, R, U, R', Y, Y, R', F, R, U, R', F', R, Y, L, U', L', U, Y, Y, Y, Y, U, Y, Y, Y, Y, U, Y, Y, R, U', R, U, R, U, R, U', R', U', R2]
>>> utils.solve(cube, 'Kociemba')
[L', F, B2, R', B, R', L, B, D', F', U, B2, U, F2, D', R2, L2, U, F2, D']

Cube Notation

For a better and more in depth explanation about the cube moves notation visit https://ruwix.com/the-rubiks-cube/notation/

The configuration string of the cube corresponds to the color of the stickers according to the following figure

               ----------------
               | 0  | 1  | 2  |
               ----------------
               | 3  | 4  | 5  |
               ----------------
               | 6  | 7  | 8  |
               ----------------
-------------------------------------------------------------
| 9  | 10 | 11 | 18 | 19 | 20 | 27 | 28 | 29 | 36 | 37 | 38 |
-------------------------------------------------------------
| 12 | 13 | 14 | 21 | 22 | 23 | 30 | 31 | 32 | 39 | 40 | 41 |
-------------------------------------------------------------
| 15 | 16 | 17 | 24 | 25 | 26 | 33 | 34 | 35 | 42 | 43 | 44 |
-------------------------------------------------------------
               ----------------
               | 45 | 46 | 47 |
               ----------------
               | 48 | 49 | 50 |
               ----------------
               | 51 | 52 | 53 |
               ----------------

So, the color at position 0, corresponds to the color of the sticker BLU, the color at 1 is BU and so on …

Colors used in the implementation are:

  • [O]range

  • [B]lue

  • [R]ed

  • [W]hite

  • [Y]ellow

  • [G]reen

NOTE

Kociemba solver needs the following cubies at place:

  • 4 (Upper center): YELLOW

  • 13 (Left center): BLUE

  • 22 (Front center): RED

  • 31 (Right center): GREEN

  • 40 (Back center): ORANGE

  • 49 (Down center): WHITE

TODO

  • Improve documentation

  • Improve Kociemba Solver tests

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

solvecube-0.0.4.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

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

solvecube-0.0.4-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file solvecube-0.0.4.tar.gz.

File metadata

  • Download URL: solvecube-0.0.4.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.0

File hashes

Hashes for solvecube-0.0.4.tar.gz
Algorithm Hash digest
SHA256 aa3b613d561e2e4ceec47287d5daf617eeb17ff4eee661d7e95c7f903682e796
MD5 3580a86f7d80a9f9b51710b37c820605
BLAKE2b-256 af4e92adf785bd2b122f69a01eac3775b70240270a2170a296ead635b49e5543

See more details on using hashes here.

File details

Details for the file solvecube-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: solvecube-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.0

File hashes

Hashes for solvecube-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9474da364b6e6f3c74d6c5794d5f26b473c710b8ffe231241442455269ab5728
MD5 9317c80b6467f5225c38d98f1113e307
BLAKE2b-256 eb5b7bbb2c6e948e0f8908ea8834bea12a61af34b635f47c7154c875975ebee9

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