12 ms·
World
- cstigler 13y agoA heavily refactored version of this code, for those curious how it works: http://pastebin.com/uUvDGzrb http://pastebin.com/uUvDGzrb (note that it will not work like the original and make a pretty globe, because it's dependent on the exact character positioning)
- deleted 13y ago[deleted]
- sylvinus 13y agoSaw the talk by Martin at JSConf.eu today explaining how he did it. Just brilliant! http://2013.jsconf.eu/speakers/martin-kleppe-1024-seconds-of-js-wizardry.html http://2013.jsconf.eu/speakers/martin-kleppe-1024-seconds-of...
- RBerenguel 13y agoI have to remember to check their YouTube channel for the talk!
- brianpgordon 13y agoIf anyone finds the video, post it here please!
- mathrawka 13y agoInspired by "The Qlobe", written in Ruby http://mamememo.blogspot.de/2010/09/qlobe.html http://mamememo.blogspot.de/2010/09/qlobe.html
- raldi 13y agoHmm, that one says, "Copyright(C).Yusuke Endoh, 2010" The author of this one apparently forgot to give credit.
- pavpanchekha 13y agoDoesn't look like the code is that similar. Doesn't look like copyright has anything to do with it. Does Endoh have a patent? That would of course be a different matter.
- ijoyce 13y agoI saw something similar in perl years ago. I can't seem to locate it now though so maybe I'm imagining things.
- dmerrick 13y agoIt looks to be a different implementation.
- adrusi 13y agoaside from the implementation being completely different and therefore not in violation of copyright, it would be difficult to give credit for something like this where every character is strategically placed.
- raldi 13y agoHow about in the bottom corner of the screen? Or in the parent directory, where there's a listing of all the demos?
- aprescott 13y agoHe also made Merry Quine-mas 2010: http://mamememo.blogspot.com/2010/12/merry-quine-mas-2010.html http://mamememo.blogspot.com/2010/12/merry-quine-mas-2010.ht...
- RBerenguel 13y agoMy jaw literally dropped, I had to check the source to make sure this was just it... Really impressive. I love these kind of works of art
- icpmacdo 13y agoInspecting the elements in chrome wont let me open the any of the code. Once you get past the body tags the <pre> tags just keep on flashing.
- mannix 13y agoGo 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.
- jhuckestein 13y agoYou can just look at the source (Ctrl+Alt+U in Chrome). It's an HTML document with a single script tag in it.
- dgudkov 13y agoJust Ctrl+U
- electic 13y agoKudos, this is amazing.
- kunai 13y agoIf you look closely you'll see that there's a parallax effect, where the lines near the equator move faster than the lines at the top, giving it a sense of depth and motion that you wouldn't expect from any ASCII art animation. This was brilliant, just absolutely fantastic.
- parasj 13y agoHere this is, formatted so it is more readable. p = "<" + "pre>"; for (y in n = "zw24l6k\ 4e3t4jn`t4qj24xh2 x42kty24wrt413n243n\ 9h243pdxt41csb yz43iyb6k43pk7243nm\ r24".split(4)) { for (a in t = parseInt(n[y], 36) + (e = x = r = [])) for (r = !r, i = 0; t[a] > i; i += .05) with(Math) x -= .05, 0 > cos(o = new Date / 1e3 + x / PI) && (e[~~(32 * sin(o) * sin(.5 + y / 7)) + 60] = -~r); for (x = 0; 122 > x;) p += " *#" [e[x++] + e[x++]] || (S = ("eval" + "(z=\'" + z.split(B = "\\\\").join(B + B).split(Q = "\'").join(B + Q ) + Q + ")//m1k")[x / 2 + 61 * y - 1]).fontcolor /\\w/.test(S) && "#03B"); document.body.innerHTML = p += B + "\\n" } setTimeout(z) * Edited for formatting
- rosser 13y agoPersonally, I find your comment less readable than TFA.
- deleted 13y ago[deleted]
- ebilgenius 13y agohttp://pastebin.com/P3eXCg07 http://pastebin.com/P3eXCg07
- parasj 13y agoWhoops, I used backticks instead of spaces to mark it as code.
- Stratoscope 13y agoTickmarks don't work here, you need to indent by two spaces. https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc
- aerolite 13y agowith :(
- nikcub 13y agoIt's spinning in the wrong direction!
- coherentpony 13y agoThat's true :)
- srgseg 13y agoReminds me of the episode of the Daily Show where Neil deGrasse Tyson informs Jon Stewart that the Earth is spinning in the wrong direction in the opening credits of the show http://www.youtube.com/watch?v=oy3PgFhIpyM#t=0m56s http://www.youtube.com/watch?v=oy3PgFhIpyM#t=0m56s
- jonsen 13y agoMaybe it was coded on board the ISS.
- xhroot 13y agohttps://s3.amazonaws.com/xhroot/world.html https://s3.amazonaws.com/xhroot/world.html Happy?
- sukaka 13y agonice work. how did you know? For anyone wondering the difference, 0>cos on line 8 is now 0<cos.
- sillysaurus2 13y agoAlmost 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.
- zwegner 13y agoReminds 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 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\ TBdFLDAANEfDNBPHdBcBBBEA_AL\ H E L L O, W O R L D! " [l++-3];)for(;n-->64;) putchar(!d+++33^ l&1);}
- russellsprouts 13y agoThere is another program arranged in a similar circular shape that calculated pi experimentally using it's own source code as the circle to test.
- zwegner 13y agoYup--that's a great one. And it too is by Brian Westley...
- ZirconCode 13y agoFound it here http://www.cise.ufl.edu/~manuel/obfuscate/pi.c http://www.cise.ufl.edu/~manuel/obfuscate/pi.c That's awesome.
- jerf 13y agoThere's a lot of talk about scalable code floating around, but it's rare to see anything as scalable as this code. Do you want more precision in your pi approximation? Then you literally scale the code up. There's few people who can truly claim to have written scalable code like that.
- justin_ 13y agoSpeaking of "scalable code", there is another interesting obfuscated piece of code that can scale itself. akari.c[1] is an obfuscated ASCII art downsampler. The neat thing is that the program itself is ASCII art, and downscaling the program source code will generate valid programs for 3 iterations![2] [1] http://www.ioccc.org/2011/akari/akari.c http://www.ioccc.org/2011/akari/akari.c [2] http://www.ioccc.org/2011/akari/hint.html http://www.ioccc.org/2011/akari/hint.html
- mistercow 13y agoThat 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."
- nine_k 13y agoI see Perl's fashion of poetic source code is being replaced by JS's fashion of animated source code! 8-)
- diericx 13y agoSomeone should make a version that spins in real time :O
- rplnt 13y agoView the source code for that. Just don't look at it for too long.
- billforsternz 13y agoAmazing stuff. One quibble; There's a XXXXX in the middle of the South Pacific, midway between Australia and Chile. Whatever it is supposed to be, it's way too big.
- scarmig 13y agoBrilliant. What I'd love to see is a step by step description of how this was constructed. If I have an end goal in mind, it's simple enough to hammer some characters into something a machine can use to do that end goal while still being readable by a human. But this? It floors me, and I can't even imagine where to start. I can understand the code with a bit of thought, but getting from an empty text editor to that seems beyond me.
- meemoo 13y agoHe gave this step by step presentation at JSConf.eu today. It was really well done... I could almost follow! I hear there will be video in a couple weeks.
- morgante 13y agoMy first thought was that's kinda cool. Then I viewed the source. Amazing.
- frozenport 13y agoIs the UK on the map?
- kul_ 13y agoit hypnotized me to upvote!
- pdenya 13y agoThat's adorable but I wouldn't have bothered clicking if I had known what it was from the title.
- mhartl 13y agoTake another look. It's not just an ASCII animation; it's the source code that produces the animation.
- MarionWBobby 13y agomy boyfriends mom just got Mercedes-Benz SL-Class SL63 AMG just by working from a home pc. this post www.work25.ℂoM
- sparist 13y agoThis is the first animated quine I've ever seen. It may be a first. More on quines: http://en.wikipedia.org/wiki/Quine_(computing) http://en.wikipedia.org/wiki/Quine_(computing)
- josephagoss 13y agoCan someone explain this really simply for me? I understand that the whole thing is actual source and its manipulating the center commented area. But I am having trouble following the code.
- lutusp 13y ago> Can someone explain this really simply for me? Imagine that you had to write it yourself. First, you would create some strings approximately representing latitudes on Earth and their associated land masses -- one string for maybe 10-20 degrees of latitude, from some southerly latitude to a northerly one. Nest, you would figure out a way to print substrings of the strings, at specific points within the strings that you would choose. Next, you would arrange that the substring printer would wrap around to the beginning of the string in the event that it was asked to print a greater length than the remaining characters available from the specific starting point to the end. By wrapping around, you create the illusion of a circle of characters, like on a globe. Next, you would think of a way to write into a specially formatted executable text file having a roughly circular central section that is commented out, i.e. not executable. Next, you would arrange that the specially formatted text file be the running program, and the central comment area represent the display of the earth. Next, just to blow minds, you would print the current form of the program text file on the console, after each animation cycle filled the comment area. Finally, you would create the illusion that the earth is rotating clockwise as seen from the north pole (the opposite of reality) just to provoke people who know a bit of astronomy.
- patrikr 13y agoWow, it even works in Opera Mini!
- salimane 13y agoit's not an accurate map, showing north america as the same size as Africa :)
- MarionWBobby 13y agoMy Uncle Colton just got a nearly new blue Chevrolet Suburban SUV just by working from a home pc. hop over to these guys http://financialzest.biz/?1=bo0356 http://financialzest.biz/?1=bo0356
- cyberscrawler 13y agoYou chopped off the Indian subcontinent
- sidcool 13y agoMaking the code look like the output!! Super cool.
- Techasura 13y agoCan someone explain this?
- scrrr 13y agoThere's a bunch of these globe animations already. But always nice. ;)
- cburgmer 13y agoaemkei delivered an awesome presentation yesterday at JSConf EU. This was his final slide.
- smoyer 13y agoYou made me eval() ... Don't be eval. Excellent piece of code though!