Skip to content

programmersd21/rubui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸงŠ rubui

A colorful 3D Rubik's Cube terminal UI with manual and auto modes.

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘
โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘
โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘
โ•šโ•โ•  โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•  โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•

Demo

๐Ÿคฉ Rubui is a high-performance, fully 3D interactive Rubik's Cube simulator that runs entirely in your terminal. No GUI, no browserโ€”just pure terminal wizardry.

๐Ÿ’ก The Spark

Amid my desk clutterโ€”PCs, USB drives, random stuffโ€”one thing caught my eye: a Rubikโ€™s Cube. I thought, โ€œWhy not bring this puzzle to my terminal?โ€ That tiny idea grew into Rubui, born from curiosity, fun, and love for coding.

๐Ÿš€ Why Rubui? Because your terminal deserves more than logs and scriptsโ€”it deserves playable 3D magic.


โœจ Features

  • ๐ŸŽฎ Manual Mode โ€” Solve the cube with keyboard controls
  • ๐ŸŒ€ Auto Mode โ€” Watch the cube scramble like a colorful screensaver
  • ๐ŸงŠ 3D Isometric Rendering โ€” Three visible faces with depth and shading
  • ๐ŸŽจ Rich ANSI Colors โ€” Vibrant face colours with theme support
  • โŒจ๏ธ Real Cube Notation โ€” R, U, F, L, D, B + primes + doubles
  • ๐Ÿ”„ Undo / Redo โ€” Full move history
  • ๐Ÿค– Auto Solve โ€” Kociemba twoโ€‘phase solver integration
  • โšก Smooth Animation โ€” Frame-based move transitions
  • ๐Ÿ“ Command Prompt โ€” Type move sequences in-app
  • โš™๏ธ Config System โ€” TOML config with CLI overrides
  • ๐ŸŽญ Themes โ€” Dark, light, and monochrome
  • ๐Ÿ“Š Live Status Bar โ€” Mode, moves, timer, FPS, theme

๐Ÿš€ Installation

# Clone the repository
git clone https://github.com/programmersd21/rubui.git
cd rubui

# Install in development mode
pip install -e .

# Run it!
rubui

Requirements

  • Python 3.10+
  • A terminal with ANSI color support (Windows Terminal, iTerm2, any modern Linux terminal)

๐ŸŽฎ Usage

# Start in manual mode (default)
rubui

# Start in auto/screensaver mode
rubui -m auto

# Start scrambled
rubui --scramble

# Auto-solve the current cube (uses kociemba)
rubui --solve

# Deterministic scramble for testing
rubui --scramble --seed 42

# Control auto mode speed
rubui -m auto --speed 0.1

# Use a different theme
rubui --theme light

# Disable colours
rubui --no-color

# Generate default config
rubui init

โŒจ๏ธ Controls (Manual Mode)

Key Action
R L U D F B Face turns (clockwise)
r l u d f b Wide turns (Rw/Lw/Uw/Dw/Fw/Bw)
' then move Prime turn (X')
2 then move Double turn (X2)
x y z Whole cube rotations
Arrow keys Rotate cube view
s Scramble
v Solve (kociemba)
Ctrl+Z Undo
Ctrl+Y Redo
m Switch manual/auto mode
: or / Open command prompt
? Show help
q Quit

Command Prompt

Press : or / to enter the command prompt. Type standard cube notation:

R U R' U'
F2 D L' U2

Press Enter to execute, Escape to cancel.


โš™๏ธ Configuration

rubui supports TOML configuration files with the following priority:

  1. CLI arguments (highest)
  2. Local rubui.toml (current directory)
  3. Global ~/.config/rubui/rubui.toml
  4. Built-in defaults (lowest)

Generate a default config:

rubui init

Example rubui.toml:

[app]
mode = "manual"
theme = "dark"
scramble_on_start = false
solve_on_start = false
color = true

[auto]
fps = 60
speed = 0.05

[scramble]
length = 25
seed = 0

๐Ÿ—๏ธ Architecture

rubui/
โ”œโ”€โ”€ main.py           # CLI entry point (Typer)
โ”œโ”€โ”€ cube_engine.py    # Core 3ร—3 cube state
โ”œโ”€โ”€ moves.py          # Move execution + undo/redo
โ”œโ”€โ”€ parser.py         # Notation parser
โ”œโ”€โ”€ renderer.py       # 3D isometric renderer
โ”œโ”€โ”€ config.py         # TOML config system
โ”œโ”€โ”€ input_handler.py  # Keyboard input
โ”œโ”€โ”€ manual_mode.py    # Interactive manual mode
โ”œโ”€โ”€ auto_mode.py      # Screensaver auto mode
โ”œโ”€โ”€ solver.py         # Kociemba solver integration
โ””โ”€โ”€ utils.py          # Terminal utilities + themes

See docs/architecture.md for detailed module documentation.


๐Ÿงช Testing

pip install -e ".[dev]"
python -m pytest tests/ -v

๐Ÿ“œ License

MIT โ€” see LICENSE.


๐Ÿค Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for new features
  4. Submit a pull request

Made with โค๏ธ for cube enthusiasts who live in the terminal.

About

๐ŸงŠ 3D Rubikโ€™s Cube in your terminal โ€” manual & auto modes, smooth animations, ANSI colors, and playable magic!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages