Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Code Golf: Four is magic

by thundergnat (Deacon)
on Jul 14, 2010 at 17:27 UTC ( #849578=note: print w/ replies, xml ) Need Help??


in reply to Re: Code Golf: Four is magic
in thread Code Golf: Four is magic

A modest improvement on your 229:
227 strokes

perl -E'@x="033544355436688779880066555766"=~/./g;$_=<>;chop;print;whi +le($_-4){split//,"99aabb87780";$x=4*!$_;$x+=hex(pop@_)*!!-$&+!!$1*($x +[$1]+7)+$x[$2+20]+$x[$3]while s/(.??)([^1]?)(1?.)$//;say" is $x.";pri +nt$_=$x}say" is magic."'


Comment on Re^2: Code Golf: Four is magic
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (17)
As of 2015-07-02 17:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (44 votes), past polls