First, note that the v=
line and the ASCII globe are the only bits of the code that change on each generation. This gives us a bit of a hint as to what's really going on here.
The basic principle is that the globe model was encoded with Zlib::Deflate
in the first half of the code, and the second half expands it with Zlib::Inflate
, reads it, and draws the ASCII globe within the new code, with the new v
value. There's nothing particularly special about the 45° shifts; the code will draw the globe at whatever rotation you like. (In fact, it takes a command line argument specifying the number of degrees, if you like.)
For more implementation details, I'd recommend expanding the source code and tracing through it, with that basic understanding of how the quine is designed :)