A rubik's cube solver | 魔方还原(层先法 + Two-phase)
A rubik's cube solver.
├── cube
│ └── js
│ ├── lbl.js # Layer by layer algorithm
│ ├── two-phase.js # Two-phase algorithm
│ ├── util.js # Type, shuffle and reset
│ └── initial.js # Initial a cube
└── lib
├── cubejs # Two-phase algorithm
└── cuber # Rubik's cube simulator
The cube simulator is from Cuber.
Back(B)
-----------
/ Up(U) /|
/ 1 / |
----------- Right(R)
| | |
Left(L) | Front(F) | .
| | /
| |/
-----------
Down(D)
A capital letter by each face itself means a clockwise rotation of the face while a counterclockwise turn is marked by a small letter.
For example:
U: A quarter clockwise turn on the Up face (90°).
u: A quarter counterclockwise turn on the Up face (-90°).
S/s: Rotate slice S like a F/f
M/m: Rotate slice M like a L/l
E/e: Rotate slice E like an U/u
The JavaScript implentation of Herbert Kociemba's two-phase algorithm is from cube.js.