laziness, impatience, and hubris | |
PerlMonks |
Re: Golf: Arbitrary Alphabetical Sortingby tadman (Prior) |
on May 10, 2001 at 03:09 UTC ( [id://79285]=note: print w/replies, xml ) | Need Help?? |
Taking a few tricks from tilly, and influences from
merlyn, this one appears to be 74 characters:
This will only work on single character 'alphabets', or those that y// can handle as UNICODE. Update: I forgot to include the "\Q" and "\E" escapes to prevent it from going south if the "alphabet" contained characters such as '/' or '\n'. 4 character penalty. Update 2: If you want to cheat, you can always insert the literal character ASCII 255 into the string instead of the comparatively verbose '\377', which saves 3 characters, yielding a length of 71, though some editors show that single "character" as 2 on screen.
In Section
Meditations
|
|