Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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."'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://849578]
Corion idly wonders if there is a way to produce ordered .yml files. I want to accept YAML for a configuration file format, but I also want to generate (for debugging/start) a sample configuration file from the current configuration.
[Corion]: Ideally, that configuration file would have some order of the keys, but I'm not sure whether/how YAML supports ordered output.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2017-01-16 11:56 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (149 votes). Check out past polls.