Live data from Hacker News

World

aem1k.com

31–40 of 102 posts

Re: World

#32
That was a wonderful experience of multiple moments of realization. "Oh, it's an ascii globe; it looks like it just scrolls a map through the circle. No wait, it's warping as it shifts across. Wait, is it using asterisks for antialiasing? What is all of this stuff around the outsi- ... oh. Oh."

Re: World

#37
I see Perl's fashion of poetic source code is being replaced by JS's fashion of animated source code! 8-)

Re: World

#38
post #35
post #30

Earlier quoted context omitted.

https://s3.amazonaws.com/xhroot/world.html Happy?

nice work. how did you know? For anyone wondering the difference, 0>cos on line 8 is now 0<cos.

Almost any kind of rotation in 2D or 3D graphics involves cos or sin. The spinning was going the wrong way, therefore the way to reverse it was to reverse something involving cos or sin. You can then just bruteforce it by reversing each cos until you get the effect you want. (If reversing cos seems to reverse something "perpendicular" to what you want, then you'd need to reverse the sin instead, not the cos.)

This is true in almost any context involving 2D/3D graphics, not just for this particular example. It's much more efficient than trying to sit there and think through the math or figure out what does what. But of course you learn less that way, so it's a tradeoff. And sometimes it's less efficient if there are too many combinations to efficiently bruteforce, or if it takes too long to test each iteration. But we live in the age of rapid-iteration javascript.

Re: World

#39
post #18

Reminds me of the old 1992 winner of the IOCCC by Brian Westley (who consistently entered some of the most impressive programs in that contest). It doesn't spin, but it prints a map of the provided lat/long. http://www.ioccc.org/1992/westley.hint main(l ,a,n,d)char**a;{ for(d=atoi(a[1])/10*80- atoi(a[2])/5-596;n="@NKA\ CLCCGZAAQBEAADAFaISADJABBA^\ SNLGAQABDAXIMBAACTBATAHDBAN\ ZcEMMCCCCAAhEIJFAEAAABAfHJE\ TBdFLDAANEfD…

There is another program arranged in a similar circular shape that calculated pi experimentally using it's own source code as the circle to test.

Found it here http://www.cise.ufl.edu/~manuel/obfuscate/pi.c That's awesome.

Re: World

#40
post #9

Earlier quoted context omitted.

Go to the Sources tab and click the || button to pause javascript. If you're wondering where the code is, just curl the URL :) (or, with Web Inspector open, refresh the page, go to the Network tab and select the only request.

You can just look at the source (Ctrl+Alt+U in Chrome). It's an HTML document with a single script tag in it.

Just Ctrl+U
Post reply on HN