Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Code Golf: Four is magic

by deMize (Monk)
on Jul 14, 2010 at 02:22 UTC ( #849405=note: print w/ replies, xml ) Need Help??


in reply to Code Golf: Four is magic

144 chars:
@u=split//,'4335443554366887798866555766';$_=<>;chop;print"$_ is ".($_=$_-4?$_<20?$u[$_]:$u[$_/10+18]+($_%10&&$u[$_%10]):0or magic).".\n"while$_


Demize


Comment on Re: Code Golf: Four is magic
Download Code
Re^2: Code Golf: Four is magic
by deMize (Monk) on Jul 14, 2010 at 05:00 UTC
    125 chars:
    @u='4335443554366887798866555766'=~/./g;$_=pop;print"$_ is ",$_=$_-4?$_<20?$u[$_]:$u[$_/10+18]+$u[$_%10]:magic,".\n"until/\D/


    Demize

      That is broken for 30, 40, 50, etc.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://849405]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-12-22 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (116 votes), past polls