From 8b2c446454d7da24e0f782dc2b9a93a812d219b4 Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 26 May 2024 13:49:24 -0500 Subject: [PATCH] Demonstrate 4 choose 4 --- examples/four.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/four.rs b/examples/four.rs index 459e979..e82985f 100644 --- a/examples/four.rs +++ b/examples/four.rs @@ -22,4 +22,14 @@ fn main() { } let (size, _) = permute::choose_permute::<_, 4>(&choose_input).size_hint(); println!("size {size}"); + println!(); + + let same_len_input = [1, 2, 3, 4]; + + for (i, permutation) in permute::choose_permute::<_, 4>(&same_len_input).enumerate() { + println!("{i}: {permutation:?}"); + } + let (size, _) = permute::choose_permute::<_, 4>(&same_len_input).size_hint(); + println!("size {size}"); + println!(); }