Crates.io | alg-cli |
lib.rs | alg-cli |
version | 0.13.10 |
source | src |
created_at | 2024-11-01 11:57:08.309202 |
updated_at | 2024-11-01 19:50:24.91224 |
description | Alg tool. |
homepage | https://github.com/cubing/cubing.rs |
repository | https://github.com/cubing/cubing.rs |
max_upload_size | |
id | 1431712 |
size | 16,819 |
cubing.rs
Features from cubing.js
in Rust.
See https://docs.rs/cubing/latest/cubing/ for Rust docs.
A subset of the cubing.js
API is implemented under:
cubing::alg
cubing::kpuzzle
cubing::puzzles
Most applications will use str.parse::<Alg>(…)
and KPuzzle
as entry points into the API:
use cubing::{alg::parse_alg, puzzles::cube3x3x3_kpuzzle};
pub fn main() {
let kpuzzle = cube3x3x3_kpuzzle();
let default_pattern = kpuzzle.default_pattern();
let input_alg = parse_alg!("R U R' F' U2 L' U' L F U2");
let input_pattern = default_pattern
.apply_alg(&input_alg)
.expect("Input alg is not valid for puzzle.");
println!(
"The following alg {} the puzzle to its original pattern (including center orientation): {}",
if default_pattern == input_pattern { "returns" } else { "does NOT return" },
input_alg,
)
}
This repository contains a port of f2lfast
that is useful for exercising functionality (although it's not yet at full speed):
cargo run --example f2lfast -- --scramble "U2 F2 U' L' U L D2 F D2 B' D2 B D2 L2 B L2 F"
Run tests using:
make test