Sitelet https://github.com/ShugKnight24/the_cube
Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rubik's Cube 3D Simulator

Interactive 3D Rubik's Cube with prediction engine, solver helper, and personal best ghost racer.

Preview

Install

No installation required. Run directly in browser.

# Open in browser
open index.html

Usage

Interactive Play

  • Orbit View: Click and drag empty space around cube.
  • Rotate Face: Click and drag a colored tile directly on the cube.
  • Keyboard Shortcuts: Press U, D, F, B, L, R. Hold Shift for counter-clockwise.

Solver Stats

  • Optimal Solve: Shows the minimum moves required to solve from the current state in real-time.

Prediction Engine

  • Click eyeball button (bottom: 10rem) to open.
  • Click keypad buttons or type sequence (e.g., R U R' U') to preview moves.
  • Click Play to animate the preview sequence.
  • Click Apply to execute the sequence on the main interactive cube.

Fastest Ghost Mode

  • Click ghost button (bottom: 14rem) to toggle.
  • Loads personal best (PB) solve from localStorage (runs default 6s solve if no PB exists).
  • Click Scramble to load the exact scramble configuration.
  • Ghost starts playback when you make your first move.
  • HUD shows live move and time deltas against your ghost.

Programmatic API

Class RubiksCube provides standard interface:

const cube = new RubiksCube(container, {
  rotationSpeed: 300,
  enableUI: true
});

cube.scramble(20);          // scramble
cube.executeMove('R', 1);   // rotate Right face clockwise
cube.undo();                // undo move
cube.solve();               // run solver

About

Rubiks Cube Visualizer

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages