Crate cubesim[][src]

Expand description

A simple Rubik’s Cube simulator (and eventually solver).

Quick Start Guide

To quickly get a Rubik’s Cube simulation running, we can follow the code sample below:

use cubesim::prelude::*;
use cubesim::cube_implementors::FaceletCube;
 
let cube = FaceletCube::new(3);
let turned_cube = cube.apply_move(Move::U(MoveVariant::Double));
println!("{:?}", turned_cube.get_state());

Cube Trait Overview

To support multiple underlying implementations of a Rubik’s Cube, we define a Cube trait which define the minimal set of behaviours expected of a Rubik’s Cube. Specific implementations can then be used for different scenarios that fit its characteristics. For example, the FaceletCube is the most performant and versatile while the GeoCube allows for easy 3D modelling.

Structs

A Rubik’s Cube with stickers stored sequentially in a 1-dimensional array.

A Rubik’s Cube with pieces represented as 3-dimensional vectors.

Enums

A face of a Rubik’s Cube sticker represented in WCA notation.

A move of a 3 x 3 x 3 Rubik’s Cube represented in WCA notation.

A move variation that must be applied to the Move struct.

Traits

A Rubik’s Cube of arbitrary size.

Functions

Converts a WCA Notation scramble into Vec<Move>.