File size: 1,735 Bytes
feff440
 
 
 
 
dfb87f4
feff440
50751c0
1815be7
b24b865
50751c0
a6517cd
50751c0
feff440
580f78c
 
 
50751c0
a478bce
2b992b5
a478bce
280d9eb
1cbab28
 
a478bce
 
 
 
 
 
 
 
 
 
1cbab28
 
 
50751c0
feff440
580f78c
 
 
 
 
 
 
 
 
 
feff440
 
ea09e61
 
 
 
65c278c
ea09e61
 
 
b24b865
 
 
 
ea09e61
 
 
b24b865
ea09e61
a6517cd
 
 
5457ec8
 
a6517cd
5457ec8
a6517cd
5457ec8
a6517cd
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Rubik-Tensor


## Setup

This project uses `uv 0.7` as environment & dependency manager, and `python 3.11` as core interpreter. Install the project with

```shell
uv venv
-- Activate env --
uv sync
pre-commit install
```

## Usage

### Create a cube

```python
from rubik.cube import Cube

cube = Cube(['U', 'L', 'C', 'R', 'B', 'D'], size = 3)

# display the cube state and history of moves
print(cube)
#     UUU        
#     UUU
#     UUU
# LLL CCC RRR BBB
# LLL CCC RRR BBB
# LLL CCC RRR BBB
#     DDD
#     DDD
#     DDD

print(cube.history)
# []
```

### Perform basic moves

```python
# shuffle the cube using 1000 random moves
cube.shuffle(num_moves=1000, seed=0)

# rotate it in some way
cube.rotate('X2 X1i Y1i Z1i Y0 Z0i X2 X1i Y1i Z1i Y0 Z0i')
```

## Roadmap

#### Fully tensorized Rubik Cube model

- ☑️ Tensorized states.
- ☑️ Tensorized actions.
- ☑️ Interface for performing actions.

#### Movement explorer

- ⬜ Explore changes resulting from a sequences of moves.
- ⬜ Find least sequences of moves satisfying some input constrains.

#### Visualization interface

#### Base solvers following rule-based policies




## Related projects

Open-source projects related to Rubik's Cube, sorted by number of stars:
- [adrianliaw/PyCuber](https://github.com/adrianliaw/PyCuber)
- [pglass/cube](https://github.com/pglass/cube)
- [dwalton76/rubiks-cube-NxNxN-solver](https://github.com/dwalton76/rubiks-cube-NxNxN-solver)
- [bellerb/RubiksCube_Solver](https://github.com/bellerb/RubiksCube_Solver)
- [trincaog/magiccube](https://github.com/trincaog/magiccube)
- [charlstown/rubiks-cube-solver](https://github.com/charlstown/rubiks-cube-solver)
- [staetyk/NxNxN-Cubes](https://github.com/staetyk/NxNxN-Cubes)