Cubedesu: The Best Rubik's Cube Simulator in Rust


Rubik's Cube simulator written in Rust


  • Simulation of an arbitrarily sized NxNxN Rubik's Cube, allowing moves with keyboard input


Build the project (optionally in release mode):

$ cargo build [--release]

Run the project:

$ cargo run

Or use the web version:

Refer to keymap for controls

Project Structure

  • src/lib: Cube related types, such as a Face, Move, Turn, Movement (a Move associated with a Turn)
  • src/geometry_model: Geometric implementation of a cube, represented with an array of all the cube's stickers (3-dimensional points) and moves as rotations amongst some axis
  • src/facelet_model: Facelet implementation of a cube, represented as an array of stickers, ordered by U, R, F, D, L, then B face
  • src/vec3: Custom memory-efficient 3D vector implementation designed specifically for the geometry model


  • Thanks to macroquad, brilliant and simple API that helped with easily rendering a cube
  • Thanks to strum, facilitated parsing of strings into Moves and Turns as well as enum iteration and serialization
  • Thanks to proptest, great for property-based testing

Resources Used

Download details:

Author:  stanleydesu

License: MIT license


Cubedesu: The Best Rubik's Cube Simulator in Rust
1.05 GEEK