Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stanleydesu/cubedesu
Rubik's Cube simulator in Rust.
https://github.com/stanleydesu/cubedesu
3d-graphics proptest rubiks-cube rubiks-cube-simulator rust
Last synced: about 1 month ago
JSON representation
Rubik's Cube simulator in Rust.
- Host: GitHub
- URL: https://github.com/stanleydesu/cubedesu
- Owner: stanleydesu
- License: mit
- Created: 2021-09-27T10:40:31.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-29T03:37:39.000Z (over 1 year ago)
- Last Synced: 2024-08-03T03:02:20.392Z (5 months ago)
- Topics: 3d-graphics, proptest, rubiks-cube, rubiks-cube-simulator, rust
- Language: Rust
- Homepage:
- Size: 5.62 MB
- Stars: 17
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-quads - cubedesu - Rubik's Cube simulator. (Games / Games: On top of macroquad)
README
# cubedesu
Rubik's Cube simulator written in Rust
## Features
- Simulation of an arbitrarily sized NxNxN Rubik's Cube, allowing moves with [keyboard input](./keymap.png)![Cube](./cubedesu.gif)
## Usage
Build the project (optionally in release mode):
```sh
$ cargo build [--release]
```Run the project:
```sh
$ cargo run
```Or use the web version: https://stanleydesu.github.io/cubedesu/
Refer to [keymap](./keymap.png) 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## Dependencies
- Thanks to [macroquad](https://crates.io/crates/macroquad), brilliant and simple API that helped with easily rendering a cube
- Thanks to [strum](https://crates.io/crates/strum), facilitated parsing of strings into Moves and Turns as well as enum iteration and serialization
- Thanks to [proptest](https://crates.io/crates/proptest), great for property-based testing## Resources Used
- [Onionhoney's extremely well written article on modelling Rubik's Cubes](https://observablehq.com/@onionhoney/how-to-model-a-rubiks-cube)