Rubik-Tensor / README.md
JBAujogue's picture
add ability to compute changes associated with a sequence of moves
b24b865
|
raw
history blame
1.74 kB

Rubik-Tensor

Setup

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

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

Usage

Create a cube

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

# 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: