Skip to content

Commit 92d0b91

Browse files
authored
Update README.md
1 parent a8f5b0a commit 92d0b91

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@
22

33
Py222 is a 2x2x2 Rubik's Cube representation written in Python. It has support for applying individual moves to the puzzle, as well as space-separated algorithm strings specified in [WCA notation](https://www.worldcubeassociation.org/regulations/#article-12-notation).
44

5+
A cube's state is represented as a 24-element numpy array with indices corresponding to the following stickers, and values corresponding to the following face colors:
6+
7+
```
8+
sticker indices:
9+
┌──┬──┐
10+
│ 0│ 1│
11+
├──┼──┤
12+
│ 2│ 3│
13+
┌──┬──┼──┼──┼──┬──┬──┬──┐
14+
│16│17│ 8│ 9│ 4│ 5│20│21│
15+
├──┼──┼──┼──┼──┼──┼──┼──┤
16+
│18│19│10│11│ 6│ 7│22│23│
17+
└──┴──┼──┼──┼──┴──┴──┴──┘
18+
│12│13│
19+
├──┼──┤
20+
│14│15│
21+
└──┴──┘
22+
23+
face colors:
24+
┌──┐
25+
│ 0│
26+
┌──┼──┼──┬──┐
27+
│ 4│ 2│ 1│ 5│
28+
└──┼──┼──┴──┘
29+
│ 3│
30+
└──┘
31+
```
32+
533
The move definitions are written for a sticker representation, but there are functions to normalize the state's stickers relative to a fixed DLB corner, and convert it into a fixed-corner piece orientation and permutation (OP) representation. There are also various functions that can hash the fixed-corner OP representation state into unique integer indices.
634

735
Also included is a sample IDA\* solver (solver.py).

0 commit comments

Comments
 (0)