Jump to content

Prime triangle: Difference between revisions

m
→‎{{header|Perl}}: document the why the 'splice' sometimes needed
m (→‎{{header|Perl}}: splice out 'undef' list element)
m (→‎{{header|Perl}}: document the why the 'splice' sometimes needed)
Line 792:
my $nope = 0;
for my $o (permutations [@odd_nums]) {
my @list = (zip(@$e, @$o), $n); # 'zip' makes a list with a gap if more evens than odds
splice @list, -2, -1 if not defined $list[-2]; # in which case splice out 'undef' in next-to-last position
my $it = slideatatime(1, 2, @list);
while ( my @rr = $it->() ) {
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.