A Python utility package for generating scrambles for twisty puzzles
Project description
pyTwistyScrambler
A Python package for generating scrambles of various twisty puzzles, including the Rubik's cube, 4x4x4 cube, and others. Thanks to csTimer for providing the bulk of the Javascript scrambling source code around which this project is a wrapper. Also thanks to torchlight for the FTO random-state Javascript scrambling source.
Example usage
from pyTwistyScrambler import scrambler333, scrambler222, scrambler444,\
megaminxScrambler, squareOneScrambler, ftoScrambler, rexScrambler
scrambler333.get_WCA_scramble()
# D2 L F2 L2 F2 U2 L D2 F2 L' B' U2 F2 D' F D2 B' U2 R U'
scrambler222.get_WCA_scramble()
# R' F2 U2 R' U R2 F' U' F' U'
scrambler444.get_WCA_scramble()
# L2 F D2 R U Fw' Uw D L F Rw D' F L2 F' Rw' F Uw B' F' L2 B' U' Rw' F B R' D U2 L2 Fw' B D' Rw' Uw' B' Fw' R2 L2 U
megaminxScrambler.get_WCA_scramble()
# R-- D-- R++ D++ R++ D++ R++ D++ R++ D++ U R-- D++ R-- D++ R-- D++ R-- D++ R-- D-- U' R-- D++ R-- D-- R-- D++ R-- D-- R-- D-- U' R++ D++ R-- D-- R++ D-- R-- D++ R-- D-- U' R-- D-- R++ D++ R++ D-- R++ D++ R++ D-- U' R-- D-- R++ D-- R++ D-- R++ D-- R++ D++ U R++ D-- R++ D-- R++ D++ R-- D-- R++ D++ U
squareOneScrambler.get_WCA_scramble()
# (0, -1)/(4, 1)/(-4, 5)/(0, -3)/(1, -2)/(3, 0)/(2, 0)/(0, -3)/(4, -3)/(0, -4)/(2, 0)/(5, -2)/(4, 0)
ftoScrambler.get_random_state_scramble()
# U L' U' L U L' U L' U' L' U' L' U' L' U L U' L' F L R L' F L U' F' R' U' R B R BR R' BL B'
rexScrambler.get_random_state_scramble()
# f F R F' R' f' F' L' F' f R' f' R F f' L f F R F' f' R f L' f' F' R L' f' L r l L' f L r'
What scrambles can be generated?
3x3x3 (Rubik's cube)
In scrambler333 module:
get_WCA_scramble()random state scramble (WCA)get_3BLD_scramble()BLD scrambleget_edges_scramble()edges-onlyget_corners_scramble()corners-onlyget_LL_scramble()LL (last layer)get_F2L_scramble()F2L (first two layers)get_easy_cross_scramble(n=4)easy cross (where cross can be solved innmoves)get_LSLL_scramble()LSLLget_ZBLL_scramble()ZBLLget_ZZLL_scramble()ZZLLget_ZBLS_scramble()ZBLSget_LSE_scramble()LSEget_CMLL_scramble()CMLLget_CLL_scramble()CLLget_ELL_scramble()ELLget_EOLine_scramble()EO Lineget_2genRU_scramble()2-gen with RU movesget_2genLU_scramble()2-gen with LU movesget_2genMU_scramble()2-gen with MU movesget_3genFRU_scramble()3-gen with FRU movesget_3genRUL_scramble()3-gen with RUL movesget_3genRrU_scramble()3-gen with RrU movesget_half_turns_scramble()half-turns only
2x2x2
In scrambler222 module:
get_WCA_scramble()random scramble (WCA)get_optimal_scramble()optimal random state scramble
4x4x4
In scrambler444 module:
get_WCA_scramble(n=40)random scramble (WCA) of lengthnget_4BLD_scramble(n=40)alias ofget_WCA_scrambleget_SiGN_scramble(n=40)SiGN-notation scramble of lengthnget_random_state_scramble()random state scramble (note: this is slow)get_edges_scramble(n=8)edges scramble
5x5x5
In scrambler555 module:
get_WCA_scramble(n=60)random scramble (WCA) of lengthnget_5BLD_scramble(n=60)alias ofget_WCA_scrambleget_SiGN_scramble(n=60)SiGN-notation scramble of lengthnget_edges_scramble(n=8)edges scramble
6x6x6
In scrambler666 module:
get_WCA_scramble(n=80)random scramble (WCA) of lengthnget_SiGN_scramble(n=80)SiGN-notation scramble of lengthnget_edges_scramble(n=8)edges scramble
7x7x7
In scrambler777 module:
get_WCA_scramble(n=100)random scramble (WCA) of lengthnget_SiGN_scramble(n=100)SiGN-notation scramble of lengthnget_edges_scramble(n=8)edges scramble
Pyraminx
In pyraminxScrambler module:
get_WCA_scramble()random scramble (WCA)get_optimal_scramble()optimal random state scramble
Megaminx
In megaminxScrambler module:
get_WCA_scramble(n=70)random scramble (WCA) of lengthnget_Carrot_scramble(n=70)Carrot-notation scramble of lengthnget_old_style_scramble(n=70)old-style scramble of lengthn
Square-1
In squareOneScrambler module:
get_WCA_scramble()random scramble (WCA)get_face_turn_metric_scramble(n=40)face-turn metric scramble of lengthnget_twist_metric_scramble(n=20)twist metric scramble of lengthn
Skewb
In skewbScrambler module:
get_WCA_scramble()random scramble (WCA)get_ULRB_scramble()ULRB scramble
Clock
In clockScrambler module:
get_WCA_scramble()Clock scramble (WCA notation)get_Jaap_scramble()Clock scramble (Jaap notation)get_concise_scramble()Clock scramble (concise notation)get_efficient_pin_order_scramble()Clock scramble (efficient pin order notation)
FTO (Face-turning octahedron)
In ftoScrambler module:
get_random_state_scramble()random-state scramble (note: this takes ~10s per scramble)get_multiple_random_state_scrambles(n)returns a list ofnrandom-state scramblesget_random_moves_scramble(n=30)random-moves scramble of lengthn
If you need multiple random-state scrambles, it's much faster to use get_multiple_random_state_scrambles than
calling get_random_state_scramble multiple times; the former takes the usual ~10s for the first scramble but then
the remaining scrambles are much faster (less than 1s per scramble). This is due to how the underlying FTO scrambler
generates background data during the first scramble which is used to speed up subsequent scrambles.
Rex Cube
In rexScrambler module:
get_random_state_scramble()random-state scramble (note: this takes ~10s per scramble)get_multiple_random_state_scrambles(n)returns a list ofnrandom-state scramblesget_random_moves_scramble(n=30)random-moves scramble of lengthn
Since Rex Cube and FTO are mechanically the same puzzle, this is actually a wrapper around ftoScrambler which
translates the FTO notation to Rex Cube notation.
If you need multiple random-state scrambles, it's much faster to use get_multiple_random_state_scrambles than
calling get_random_state_scramble multiple times; the former takes the usual ~10s for the first scramble but then
the remaining scrambles are much faster (less than 1s per scramble). This is due to how the underlying FTO scrambler
generates background data during the first scramble which is used to speed up subsequent scrambles.
Big cubes
In bigCubesScrambler module:
get_8x8x8_scrambler(n=120)8x8x8 scramble (SiGN notation) of lengthnget_9x9x9_scrambler(n=120)9x9x9 scramble (SiGN notation) of lengthnget_10x10x10_scrambler(n=120)10x10x10 scramble (SiGN notation) of lengthnget_11x11x11_scrambler(n=120)11x11x11 scramble (SiGN notation) of lengthn
Cuboids
In cuboidsScrambler module:
get_1x1x2_scramble()1x1x2 cuboid scrambleget_1x3x3_scramble()1x3x3 cuboid (floppy cube) scrambleget_floppy_cube_scramble()alias ofget_1x3x3_scramble()get_super_floppy_cube_scramble()1x3x3 cuboid (super floppy cube) scrambleget_2x2x3_scramble()2x2x3 cuboid scrambleget_3x3x2_scramble()3x3x2 cuboid scrambleget_3x3x4_scramble()3x3x4 cuboid scrambleget_3x3x5_scramble(n=25)3x3x5 cuboid scramble, wherenis the length of the non-3x3 portion of the scrambleget_3x3x6_scramble()3x3x6 cuboid scrambleget_3x3x7_scramble(n=40)3x3x7 cuboid scramble, wherenis the length of the non-3x3 portion of the scramble
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytwistyscrambler-1.7.tar.gz.
File metadata
- Download URL: pytwistyscrambler-1.7.tar.gz
- Upload date:
- Size: 71.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ed896946259bf64995f0d472e50aa2cc205b15d0a5694ffd59387690f708219
|
|
| MD5 |
1def9cd62cb0bfbd3c79954e32896f8c
|
|
| BLAKE2b-256 |
3dd3dee92b1445c4865565e39019ddd2789a0149293c48cbe920e42a6e573073
|
File details
Details for the file pyTwistyScrambler-1.7-py3-none-any.whl.
File metadata
- Download URL: pyTwistyScrambler-1.7-py3-none-any.whl
- Upload date:
- Size: 78.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3d0ba4426ba3b7b7d4f5a39098187a5a08c20252f6d1801296e872bdaa8b7e5
|
|
| MD5 |
c46895dab2f4dc6eb787f29cb9713af8
|
|
| BLAKE2b-256 |
f54a43fa1f27b9dd61ea13fea5bd43050212f8137c4dccfc0f4cfffd565c6729
|