hn.today

The Qlobe: Rotating Quine (2010)

mamememo.blogspot.com34 points0 comments
Screenshot of The Qlobe: Rotating Quine (2010)

The Qlobe is a Ruby quine: a program that prints a copy of its own source code, with a twist. Each run changes an angle value and produces a new version of the program, so repeatedly executing the output makes the globe appear to rotate. The creator describes it as a “global” quine, in contrast to earlier work tailored to Japanese, and presents it as a demonstration of how programming, text, and visual art can be combined in an unusually compact form.

About half the code stores a compressed map of Earth. Ruby decompresses the data, applies rotation and shape calculations, and converts the result into ASCII characters that form the globe. The program carefully arranges the image alongside the code so the displayed material does not interfere with execution or with the quine’s reproduction of itself. Viewers can animate it by repeatedly running each generated version, updating the angle, and refreshing the terminal. The discussion also notes that it was tested with Ruby 1.8.7 and 1.9.2; readers using other versions or invoking the file directly encountered syntax or execution problems.

Read on mamememo.blogspot.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.