use Algorithm::ChooseSubsets; use strict; my $ones = 2; my $twos = 3; my $i = Algorithm::ChooseSubsets->new($ones + $twos,$ones); while (my $x = $i->next) { my %on = map {($_ => 1)} @$x; my @str = map { $on{$_} ? '1' : '0' } (0..$ones+$twos-1); print @str,"\n"; }
In reply to Re: One Zero variants_without_repetition
by bduggan
in thread One Zero variants_without_repetition
by thenetfreaker
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |