#cube #rubiks #rubik #rubiks-cube

rubiks-moves

A library focusing on processing moves for 3x3 Rubiks cube

4 releases

0.0.4 Mar 8, 2023
0.0.3 Mar 6, 2023
0.0.2 Mar 4, 2023
0.0.1 Mar 4, 2023

#1020 in Math

MIT license

40KB
982 lines

rubiks-moves

A crate for manipulating algorithms for the Rubik's cube, and speed-cubing

Examples

use rubiks_moves::moves::Algorithm;

let sexy = Algorithm::from("R U R' U'").unwrap();

assert_eq!(sexy.order(), 6);
use rubiks_moves::moves::Algorithm;

let scramble = Algorithm::from("R' U' F D2 L2 F R2 U2 R2 B D2 L B2 D' B2 L' R' B D2 B U2 L U2 R' U' F").unwrap();
let solution = Algorithm::from("D2 F' D2 U2 F' L2 D R2 D B2 F L2 R' F' D U'").unwrap();

assert!(solution.solves(&scramble));

License: MIT


lib.rs:

A crate for manipulating algorithms for the Rubik's cube, and speed-cubing

Examples

use rubiks_moves::moves::Algorithm;

let sexy = Algorithm::from("R U R' U'").unwrap();

assert_eq!(sexy.order(), 6);
use rubiks_moves::moves::Algorithm;

let scramble = Algorithm::from("R' U' F D2 L2 F R2 U2 R2 B D2 L B2 D' B2 L' R' B D2 B U2 L U2 R' U' F").unwrap();
let solution = Algorithm::from("D2 F' D2 U2 F' L2 D R2 D B2 F L2 R' F' D U'").unwrap();

assert!(solution.solves(&scramble));

Dependencies

~1.4–2.2MB
~44K SLoC