Created
April 19, 2025 14:52
-
-
Save mberman84/c2519ae8777a0fb96fad0100239eadbc to your computer and use it in GitHub Desktop.
Cube Prompt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write a complete HTML/JavaScript program using Three.js that renders a fully interactive Rubik's Cube simulation of any size up to 20x20x20. The user should be able to specify the cube size dynamically (e.g., via an input or a variable), and the cube should be constructed accordingly with proper color-coded faces (standard Rubik's Cube colors: white, yellow, red, orange, blue, green). | |
Include camera controls for rotating the view, and allow for basic user interaction such as rotating layers of the cube via mouse or UI buttons. | |
Additionally, implement a "Solve" button that, when clicked, animates the cube being solved step-by-step visually. You can use a simplified solving algorithm (you do not need to match real Rubik’s solving logic) — the goal is just to animate the cube returning to its original solved state, one move at a time, with clear transitions. | |
Requirements: | |
Use Three.js for all 3D rendering. | |
Cube size should be adjustable up to 20x20x20. | |
Solver animation should be smooth and readable. | |
Keep performance in mind for larger cubes (e.g., 20x20). | |
You can simplify the user interaction and solving logic as needed — the focus is on visual simulation, not speed or optimal solving. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment