Four is magic: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: added a caveat to the REXX section header (concerning the maximum number supported).) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: minor grammar & style tweaks) |
||
Line 39:
:* You are encouraged, though not mandated to use proper sentence capitalization.
:* You may optionally support negative numbers. '''-7''' is '''negative seven'''.
:* Show the output here for a small representative sample of values, at least 5 but no more than 25. You are free to
You can choose to use a library, (module, external routine, whatever) to do the cardinal conversions as long as the code is easily and freely available to the public.
Line 193:
=={{header|Perl 6}}==
{{works with|Rakudo|2017.09}}
Lingua::EN::Numbers::Cardinal module available from the
<lang perl6>use Lingua::EN::Numbers::Cardinal;
Line 204:
$string ~= "{ card($int) } is ";
if $int = ($int == 4) ?? 0 !! card($int).chars {
$string ~= "{ card($int) }, "
} else {
$string ~= "magic.\n";
last
}
}
$string.tc
}
.&magic.say for 0, 4, 6, 11, 13, 75, 337, -164, 9876543209, 2**256;</lang>
|