The ultimate 12-faced dodecahedron puzzle simulator built with Twizzle - the premier library for puzzle visualization and interaction.
Evolved Design: Started as a cube concept, then discovered the beauty of dodecahedrons! With 12 pentagonal faces, this creates a much more visually striking and complex puzzle experience than traditional cubes.
- Authentic 12-faced megaminx with proper dodecahedron mechanics
- Advanced scrambling algorithms for realistic random states
- Dodecahedron notation support (R, U, F, L, BL, BR, DR, D, DL, B, etc.)
- Smooth animations with beautiful face rotations
- Move execution with real-time algorithm tracking
- ๐ Scramble: Generates proper dodecahedron scrambles (70 random moves)
- โจ Solve: Return to solved state instantly
- ๐ Move Counter: Track total moves and current algorithm
- Responsive design that works on all devices
- Beautiful gradient UI with glassmorphism effects
- Real-time status updates showing moves and algorithms
- Smooth animations and visual feedback
Feature | Twizzle | Three.js |
---|---|---|
Setup Complexity | ๐ข Simple (20 lines) | ๐ด Complex (200+ lines) |
Cube Knowledge | โ Built-in algorithms | โ Manual implementation |
Scrambling | โ Official algorithms | โ Random colors only |
Move Notation | โ Standard R, U, F notation | โ Custom implementation |
Performance | โ Optimized for cubes | |
Learning Curve | ๐ข Easy for cube apps | ๐ก General 3D knowledge |
- More mature than generic Cube.js libraries
- Active development by the speedcubing community
- Comprehensive feature set beyond just visualization
- Proper cube mechanics vs simplified renderers
# The server is running at:
http://localhost:8000
- ๐ Scramble: Generate a new random state (70 moves with smart move avoiding)
- โจ Solve: Return dodecahedron to solved state
- Click & Drag: Rotate the cube view
- Scroll: Zoom in/out
- Mobile: Touch gestures supported
// Clean, simple implementation with Twizzle
import { TwistyPlayer } from "https://cdn.cubing.net/js/cubing/twisty";
const player = new TwistyPlayer({
puzzle: "megaminx",
alg: "R U R' U' BL DR",
visualization: "3D",
});
- ๐ฏ Purpose-Built: Designed specifically for cube puzzles
- ๐ Proper Algorithms: Uses real scrambling and solving algorithms
- ๐ง Easy Maintenance: Much simpler codebase to extend and modify
- ๐ Better Performance: Optimized for cube-specific operations
- ๐ฑ Mobile Ready: Built-in touch and responsive support
rubiks-cube/
โโโ index.html # Main HTML with modern UI
โโโ style.css # Glassmorphism styling
โโโ app.js # Twizzle integration (~250 lines vs 500+)
โโโ README.md # This documentation
Adding new features is straightforward with Twizzle:
// Add solving algorithms
player.alg = "R U R' U' R U R' F' R U R' U' R' F R2 U' R'";
// Change puzzle type
player.puzzle = "3x3x3"; // or "4x4x4", "5x5x5", etc.
// Add different visualizations
player.visualization = "2D"; // or "3D", "experimental-2D-LL"
- ๐ค Auto-solving: Implement solving algorithms
- โฑ๏ธ Timer system: Track solving times
- ๐ฏ Pattern recognition: Identify cube states
- ๐ Statistics: Move efficiency analysis
- ๐ Multiplayer: Real-time collaborative solving
- ๐ฑ PWA: Offline mobile app capabilities
- โ Perfect for cube projects
- โ Minimal code required
- โ Official algorithms built-in
- โ Active speedcubing community
- โ Easy to extend and maintain
- โ Great for learning 3D programming
- โ General-purpose 3D engine
- โ Requires extensive cube knowledge
- โ Much more complex setup
- โ Not cube-optimized
โ ๏ธ Usually incomplete implementationsโ ๏ธ Limited community supportโ ๏ธ Often outdated or abandoned
# Server is already running on port 8000
# Just edit files and refresh browser
# To restart server if needed:
python3 -m http.server 8000
- โ Chrome/Edge: Full support
- โ Firefox: Full support
- โ Safari: Full support
- โ Mobile browsers: Responsive design
This Twizzle-based implementation demonstrates why choosing the right library is crucial:
- 20 lines of setup vs 200+ with Three.js
- Official cube algorithms vs custom implementations
- Proper cube mechanics vs basic 3D rendering
- Future-proof with active development
The cube loads faster, works better, and is much easier to extend! ๐
Ready to start puzzling? Visit http://localhost:8000
and enjoy the ultimate 12-faced dodecahedron experience! ๐โจ