A rubiks cube model and solver
Project description
rubikscube
Rubik's cube model and solver
To install:
pip install cubeofrubik
To use:
>>> from rubikscube import RubiksCube
>>> cube = RubiksCube.RubiksCube()
>>> cube.draw()
⬛ ⬛ ⬛ ⬜ ⬜ ⬜ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ ⬜ ⬜ ⬜ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ ⬜ ⬜ ⬜ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
🟧 🟧 🟧 🟩 🟩 🟩 🟥 🟥 🟥 🟦 🟦 🟦
🟧 🟧 🟧 🟩 🟩 🟩 🟥 🟥 🟥 🟦 🟦 🟦
🟧 🟧 🟧 🟩 🟩 🟩 🟥 🟥 🟥 🟦 🟦 🟦
⬛ ⬛ ⬛ 🟨 🟨 🟨 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ 🟨 🟨 🟨 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ 🟨 🟨 🟨 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
>>> cube.scramble()
'B′DU′F′DB2FRDBF2URBDB2U′D′L2D'
>>> cube.draw()
⬛ ⬛ ⬛ 🟧 🟦 🟦 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ ⬜ ⬜ 🟩 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ 🟦 🟨 ⬜ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
🟩 🟥 🟨 🟧 🟥 🟩 🟥 🟥 ⬜ 🟥 🟥 🟨
🟩 🟧 ⬜ 🟦 🟩 🟨 🟧 🟥 🟧 🟦 🟦 🟧
🟧 🟩 🟨 🟩 🟦 🟨 🟥 🟧 ⬜ 🟧 🟩 🟩
⬛ ⬛ ⬛ 🟥 🟨 🟦 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ 🟨 🟨 ⬜ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ ⬜ ⬜ 🟦 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
>>> cube.solve()
'DU′R2U′B2L′BUB′RU2R′U′RUR′FU2F′R′U′RFUF′U′FUF′LUL′U′B′U′BU2F′U′FURUR′U′LUL′U′B′U′BUFUF′U′L′U′LU2FRUR′U′RUR′U′F′RUR′URU2R′U2BUB′UBU2B′URDR′D′RDR′D′URDR′D′RDR′D′URDR′D′RDR′D′U2'
>>> cube.draw()
⬛ ⬛ ⬛ 🟨 🟨 🟨 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ 🟨 🟨 🟨 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ 🟨 🟨 🟨 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
🟧 🟧 🟧 🟦 🟦 🟦 🟥 🟥 🟥 🟩 🟩 🟩
🟧 🟧 🟧 🟦 🟦 🟦 🟥 🟥 🟥 🟩 🟩 🟩
🟧 🟧 🟧 🟦 🟦 🟦 🟥 🟥 🟥 🟩 🟩 🟩
⬛ ⬛ ⬛ ⬜ ⬜ ⬜ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ ⬜ ⬜ ⬜ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ ⬜ ⬜ ⬜ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
>>> cube.move("RUR′U′")
>>> cube.draw()
⬛ ⬛ ⬛ 🟨 🟨 🟧 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ 🟨 🟨 🟦 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ 🟨 🟨 🟦 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
🟩 🟧 🟧 🟦 🟦 ⬜ 🟥 🟥 🟨 🟩 🟥 🟥
🟧 🟧 🟧 🟦 🟦 🟨 🟩 🟥 🟥 🟩 🟩 🟩
🟧 🟧 🟧 🟦 🟦 🟦 🟨 🟥 🟥 🟩 🟩 🟩
⬛ ⬛ ⬛ ⬜ ⬜ 🟥 ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ ⬜ ⬜ ⬜ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
⬛ ⬛ ⬛ ⬜ ⬜ ⬜ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛
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
cubeofrubik-0.0.1.tar.gz
(10.4 kB
view details)
Built Distribution
File details
Details for the file cubeofrubik-0.0.1.tar.gz
.
File metadata
- Download URL: cubeofrubik-0.0.1.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb98d0ebeb01aa583818442831bb05a47e0974b2324ff1a745aa35410ef6788e |
|
MD5 | 1a729861a183ce872c3b6af31af2ce9a |
|
BLAKE2b-256 | a4f828f007f6f6b2c2371425fa20a78e152c575adcdf59cd908d92f6026283cf |
File details
Details for the file cubeofrubik-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: cubeofrubik-0.0.1-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62593f15df194b52b45e5552b9bb86f84c62b4ee5dce61af2b555d33bd901f8b |
|
MD5 | 0275390bc0d6fdb2453dca22d7b7b80d |
|
BLAKE2b-256 | ef0b9bcc8b47a001fd3b7e3ad839ce2bf930b2898d00dbc20c6f2f52d8171d9b |