Eban numbers: Difference between revisions
m
→{{header|Perl 6}}: update description to match
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: I twiddle because I can...) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: update description to match) |
||
Line 129:
=={{header|Perl 6}}==
{{works with|Rakudo|2018.12}}
Modular approach, very little is hard coded. Change the $upto order
Will handle multi-character 'bans'. Demonstrate for e-ban
Directly find :
Line 177:
"{$n}-ban numbers between 1,000 & 4,000: {+@j}\n{@j.gist}\n";
for (1 ..
my $f = @bans.first( * > $e, :k );
printf "Up to %14s: %d\n",comma($e), $f ?? +@bans[^$f] !! +@bans;
|