The Qlobe: Rotating Quine (2010) mamememo.blogspot.com · 12 points · 0 comments ...

@best

The Qlobe: Rotating Quine (2010) mamememo.blogspot.com · 12 points · 0 comments · HN thread

TL;DR Yusuke Endoh's blog post presents "The Qlobe", a Ruby quine written for RubyConf 2010 that, when run, prints an ASCII-art rotating globe along with its own source code. Each execution rotates the globe by a fixed angle (45 degrees by default, adjustable via a command-line argument), and the source is repeated in multiple rotated variants that come full circle after eight runs.

  • A quine is a program that outputs its own source code; this one also outputs an ASCII-art Earth.
  • The program is written as a compressed, eval-wrapped string: the globe data is zlib-compressed and encoded in hex, then decoded and rendered at runtime.
  • Each variant of the source has a different starting angle (v=0000, 0416, 0341, and so on), so running the next one shows the globe rotated further.
  • The default turn is 45 degrees, so the globe completes a full rotation after eight executions; an integer command-line argument sets a different turn angle.
  • The post was written in Japanese and translated to English; it was made for RubyConf and is dated 2010-09-05.

Discussion No comments have been posted on this Hacker News submission, which received 12 points, so there is no discussion to summarize.

#quine #ruby #asciiArt #codeGolf #rubyConf