Skip to content

A permutation & combination calculation crate for rust.

Notifications You must be signed in to change notification settings

micron-mushroom/but-what-about

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

but-what-about

The crate is a permutation utility that only supports Heap's algorithm. At the moment it can permute strings(by grapheme and codepoint—though, codepoint based permutation is highly questionable at the moment) and primitive numeric types by their bits. In the future I plan to add support for additional permutation algorithms and implement some combination algorithms as well. I can't say I recomment using the crate for anything more than just fun at the moment. So, do go and have fun.

use heap_permute::PermuteIter;
// Print all of the permutations of a string of three characters
fn main() {
    const STRING: &'static str = "ABC";
    for p in PermuteIter::from(STRING) {
        print!("{}, ", p);
    }
}
// Prints: 
// ABC, BAC, CAB, ACB, BCA, CBA,

About

A permutation & combination calculation crate for rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages