in reply to Lottery combinations golf
#!/usr/bin/perl $a = $ARGV[0]; place($a-6,0,(1..$a)); sub place { if ($_[0]) { for my $c ($_[1]+2..$#_) { place($_[0]-1,$c-2,@_[2..$c-1],'#',@_[$c+1..$#_]) unless $_[$c] eq '#'; } } else { print @_[2..$#_],"\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Lottery combinations golf
by sgifford (Prior) on Oct 12, 2003 at 15:30 UTC |