Jump to content

Eban numbers: Difference between revisions

m
→‎{{header|Perl 6}}: update description to match
m (→‎{{header|Perl 6}}: I twiddle because I can...)
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 -of -magnitude limitslimit to adjust the search/display ranges. Change the letter(s) given to the nban sub to changemodify which letter(s) to disallow.
 
Will handle multi-character 'bans'. Demonstrate for e-ban and, t-ban. Will handleand multisubur-character 'bans' as wellban.
 
Directly find :
Line 177:
"{$n}-ban numbers between 1,000 & 4,000: {+@j}\n{@j.gist}\n";
 
for (1 .. $upto).map: { 10**$_ } -> $e {
my $f = @bans.first( * > $e, :k );
printf "Up to %14s: %d\n",comma($e), $f ?? +@bans[^$f] !! +@bans;
10,333

edits

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