An interactive Rubik's Cube simulator built with Python + Pygame, featuring real-time cube manipulation, move history tracking, optimal solving with the Kociemba algorithm, and a manual input mode powered by a draft-cube workflow.
- 🎮 Interactive 2D Rubik's Cube simulator
- 🔀 Random scramble generation
- 🧠 Optimal / near-optimal solving using the Kociemba algorithm
- ✍️ Manual cube input mode with editable draft cube
- ✅ Validation before committing manual edits
- 📜 Move history panel
- 📋 Solution panel
- 🖱️ Button-based controls for standard cube notation
- 🧪 Piece-based cube engine instead of a simple sticker array
This project is built around a piece-based Rubik's Cube engine.
Instead of storing the cube as six flat faces only, the simulator models:
- Centers
- Edges
- Corners
- piece positions in 3D space
- face projections for rendering the unfolded 2D cube net
The UI uses a dual-cube workflow:
- Live Cube → the trusted cube used in move mode
- Draft Cube → a temporary editable clone used in input mode
- Enter Input Mode
- A draft cube is created from the live cube
- Sticker edits are applied to the draft cube, not the live cube
- The edited draft cube is validated
- If valid, the draft cube replaces the live cube
- If invalid, changes are rejected or can be cancelled
This keeps the main cube state safe while still allowing manual editing.
rubix-cube-solver/
├── assets/
│ ├── rubix_cube_architecture.png
│ └── rubix_cube_input_flow.png
├── core/
│ ├── __init__.py
│ ├── cube.py
│ ├── moves.py
│ ├── pieces.py
│ └── scramble.py
├── screenshots/
│ ├── editing.jpg
│ ├── input_mode.jpg
│ ├── scramble.jpg
│ ├── solution.jpg
│ ├── ui_default.jpg
│ └── validation.jpg
├── solver/
│ ├── __init__.py
│ └── kociemba.py
├── utils/
│ ├── __init__.py
│ ├── colors.py
│ └── faces.py
├── visualizer/
│ ├── __init__.py
│ ├── UI.py
│ ├── buttons.py
│ └── ui_state.py
├── .gitignore
├── LICENSE
├── main.py
├── README.md
└── requirements.txt
- Python
- Pygame
- Kociemba
pip install -r requirements.txtpython main.pyU, D, L, R, F, BU2, D2, L2, R2, F2, B2U', D', L', R', F', B'SCRAMBLERESETSOLVEINPUT
- Select a color button (
W, Y, R, O, B, G) - Click stickers on the cube to edit the draft cube
VALIDATEto confirm and applyCANCELto discardCLEARto reset the draft edits
This project is intended as V1 / Pichu of a larger Rubik's Cube toolchain.
Planned future evolution includes:
- 3D cube visualization
- computer vision cube input
- guided learning / teaching mode
- richer UI and animations
- Each face color follows the standard convention:
- U (Up) : Yellow
- D (Down) : White
- F (Front) : Blue
- B (Back) : Green
- R (Right) : Red
- L (Left) : Orange
Built as a deep-dive project in:
- simulation systems
- algorithmic problem solving
- UI-driven state management
- software architecture for interactive tools
Created by FuriousFire
This project is licensed under the MIT License - see the LICENSE file for details. Copyright (c) 2025 FuriousFire







