p = "<" + "pre>";
for (y in n = "zw24l6k\
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"
H E L L O, W O R L D! "
The neat thing is that the program itself is ASCII art, and downscaling the program source code will generate valid programs for 3 iterations!
(I still remember how people would describe trig in high school, it is a wonder more teachers didn't explain the cos = x, sin = y thing. Probably because my teachers did not understand math.)
Note that my experience involved going to a supposedly "good" school district. There is the entirely unrelated problem of schools varying in quality based on where you live.
Heh. Yeah, that matters.
In my experience, US highschools are very much "Okay class, today we're going to memorize these formulas."
We went through the unit circle derivation in the 8th grade and were thus showed why cos is conventionally x and sin conventionally y.
One of them explained the x/y thing, another didn't.
... and the top comment is typical negative nitpicking!
Why HN? Why?! There must be a better way!
We're encouraged here to post things that add value. But that pretty much implies either criticism or going off-topic ("hey, I've seen something similar here:", etc.). There is no practical value in "positive" comments, no matter how elaborately you can write "I liked it". Yes, it will make everyone feel a little bit better, but it hardly contributes anything of value to anyone.
Not every criticism is a valuable feedback, but every valuable feedback is a kind of criticism. And I think the best thing about HN is that it has lots of civil nitpicking (usually followed by interesting discussions), instead of circle jerks and compliments.
> Why HN? Why?! There must be a better way!
There is: it's to stop taking criticism so personally and instead extract as much value from it as one can, and discard the rest. I find it to be a good attitude for life in general, not just HN.
But here is where I disagree:
>... but it hardly contributes anything of value to anyone...
>... every valuable feedback is a kind of criticism...
Valuable feedback includes positive as well as negative. Negative is actionable feedback, but positive has just as much value in a different way.
Most people are aware that their own perceptions, thoughts, and ideas may be flawed. Negative feedback points out those flaws and should always be accepted. Positive feedback says that in spite of the flaws, there is something fundamentally worthwhile there.
And while upvotes can certainly serve as a form of positive feedback, words are even better.
I'm not suggesting that we should all post meaningless words of encouragement to everything that comes along. But if you're impressed by something you see, saying so only helps.
I guess "actionable feedback" was the phrase I was looking for.
> I'm not suggesting that we should all post meaningless words of encouragement to everything that comes along. But if you're impressed by something you see, saying so only helps.
Agree 100%. It's always nice and reassuring to get some positive feedback :).
It's an astonishingly clever piece of self-reproducing code. Did you miss the code and think it was just a crappy animation of the earth?
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.
I hear there will be video in a couple weeks.
The author of this one apparently forgot to give credit.
This was brilliant, just absolutely fantastic.
I understand that the whole thing is actual source and its manipulating the center commented area. But I am having trouble following the code.
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.
More on quines: http://en.wikipedia.org/wiki/Quine_(computing)
(note that it will not work like the original and make a pretty globe, because it's dependent on the exact character positioning)
Then I viewed the source. Amazing.
Excellent piece of code though!
This was his final slide.
In this case, the page is the source. The animation and page are one with the source.