Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Hilbert Curve

by goibhniu (Hermit)
on Dec 05, 2007 at 14:10 UTC ( #655088=note: print w/replies, xml ) Need Help??

in reply to Hilbert Curve

Wonderful. Gotta love XKCD!

I deparsed it adn pertidied it and it's still obfuscated - I'd say that's an additional ++ for an obfu post.

I humbly seek wisdom.

Replies are listed 'Best First'.
Re: Hilbert Curve
by benizi (Hermit) on Dec 06, 2007 at 00:03 UTC

    Thanks. I originally golfed it down while trying to use as few unique characters as possible. Fun 'vim' command du jour (use after you've selected some lines in Visual Line mode):

    :'<,'>!perl -lpwe '$h{$_}++for split//; END { print "\# $_ ", sprintf "\%02d", $h{$_} for grep /\S/, sort { $h{$a}<=>$h{$b} or $a cmp $b } keys \%h; }' | perl -pwe 'next unless/^\#/;$a||=$.-1;chomp;$_.=($.-$a)\%10?" ":"\n"'

    I may still write a variation that uses a different obfuscation method. (Anyone know of a golf competition that uses that metric [number of distinct chars.] as part of the score?) I think 30 was the lowest I managed while keeping it under 5 lines. (excluding the 'reŽxpanding and evaluating' code)


    The alphabetics came from 'sub', 'print', 'pop', 'if', 'my', and the 'x' operator.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (1)
As of 2022-11-27 19:32 GMT
Find Nodes?
    Voting Booth?