in reply to Re: Golf - Ordinal Suffixes
in thread Golf - Ordinal Suffixes
Very nice. Here's my 40 chars... It runs under strict, anyway...
And, combining ours can get us down to 35...sub num2ord { local $_ = shift; # 1 2 3 4 5 6 +7 # 12345678901234678901234567890123456789012345678901234567890123456789 +0 $_.qw(th st nd rd)[/(?<!1)([123])$/*$1] }
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Golf - Ordinal Suffixes
by japhy (Canon) on Oct 27, 2005 at 04:21 UTC | |
by sauoq (Abbot) on Oct 27, 2005 at 05:02 UTC | |
by hv (Prior) on Oct 27, 2005 at 09:18 UTC | |
by truedfx (Monk) on Nov 03, 2005 at 12:43 UTC |