Eban numbers: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (→{{header|Perl 6}}: Doh. Fix stupid error.) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: account for zero) |
||
Line 42: | Line 42: | ||
<lang perl6>use Lingua::EN::Numbers::Cardinal; |
<lang perl6>use Lingua::EN::Numbers::Cardinal; |
||
sub nban ( |
sub nban ($seq, $n = 'e') { ($seq).map: { next if .&cardinal.contains($n); $_ } } |
||
sub comma { $^i.flip.comb(3).join(',').flip } |
sub comma { $^i.flip.comb(3).join(',').flip } |
||
Line 61: | Line 61: | ||
@ban.append: @these |
@ban.append: @these |
||
} |
} |
||
@ban.unshift(0) if 0.&nban($n); |
|||
say "\nDisplaying output for {$n}-ban:"; |
say "\nDisplaying output for {$n}-ban:"; |
||
put my @k = @ban.grep: * <= 100; |
put my @k = @ban.grep: * <= 100; |
||
Line 99: | Line 101: | ||
Displaying output for t-ban: |
Displaying output for t-ban: |
||
1 4 5 6 7 9 11 100 |
0 1 4 5 6 7 9 11 100 |
||
Up to 100: |
Up to 100: 9 |
||
======================================== |
======================================== |
||
From 1,000 to 4,000: 0 |
From 1,000 to 4,000: 0 |
||
======================================== |
======================================== |
||
Up to 10,000: |
Up to 10,000: 56 |
||
======================================== |
======================================== |
||
Up to 100,000: |
Up to 100,000: 56 |
||
======================================== |
======================================== |
||
Up to 1,000,000: |
Up to 1,000,000: 56 |
||
======================================== |
======================================== |
||
Up to 10,000,000: |
Up to 10,000,000: 392 |
||
======================================== |
======================================== |
||
Up to 100,000,000: |
Up to 100,000,000: 392 |
||
======================================== |
======================================== |
||
Up to 1,000,000,000: |
Up to 1,000,000,000: 2744 |
||
========================================</pre> |
========================================</pre> |
||