# The Qlobe: A Rotating Earth Quine in Ruby

Yusuke Endoh's 2010 masterpiece renders a rotating globe through self-replicating code.

- **Source:** [Hacker News: Front Page](https://brifing.si/source/b07aa772-b1a0-4a76-aa18-719c6f9e2dde)
- **Published:** 2026-11-09
- **Topic:** [technology](https://brifing.si/c/technology)
- **Original article:** <http://mamememo.blogspot.com/2010/09/qlobe.html>
- **On Brifing:** https://brifing.si/s/371d24ad-76e8-4240-a051-978f76afc487

## The Qlobe Concept

The Qlobe is a specialized quine, a computer program that outputs its own source code. Created by Yusuke Endoh in 2010, this Ruby script goes beyond simple replication by rendering an ASCII-based globe that rotates 45 degrees with each execution. It serves as a complex demonstration of recreational programming and code obfuscation.

## Core Execution Mechanism

The program achieves its quine status by storing the majority of its logic within a string that is evaluated at runtime. The variable 'v' tracks the current rotation angle of the globe. By modifying this variable, the script calculates the necessary transformation for each frame, ensuring the output remains a valid, executable program.

## Data Compression Techniques

Half of the source code consists of a compressed map of the Earth. The script uses the Zlib library to inflate this data into a usable format. During execution, the program unpacks this binary data and maps it to ASCII characters, dynamically adjusting the visual representation based on the current rotation angle.

## Mathematical Geometric Projection

To create the illusion of a rotating sphere, the script employs trigonometric functions to distort the flat map data. By calculating the square root of the coordinate differences, the code determines the correct width and character density for each line, effectively projecting a 2D string array onto a 3D spherical surface.

## Technical Execution Challenges

Users attempting to run the script often encounter syntax errors if they execute it directly as a shell script rather than passing it to the Ruby interpreter. The code is highly sensitive to the Ruby version, with developers noting successful execution on versions like 1.8.7 and 1.9.2, provided the environment is correctly configured.

## Running the Simulation

To visualize the rotation, users must run the script in a loop. A common method involves using a shell command to execute the file, pipe the output to a new file, and then overwrite the original. This continuous cycle allows the program to update its own state and display the rotating animation.

## Code Obfuscation Tactics

The script utilizes various tricks to ensure that the data-heavy map does not interfere with the executable logic. By carefully structuring the eval statement and using string manipulation, Endoh prevents the ASCII globe data from being interpreted as code, maintaining the integrity of the quine while allowing for complex visual output.

## Community Reception

The Qlobe gained significant attention in the programming community for its technical ingenuity. Many developers expressed surprise at the complexity of the logic, labeling it one of the most impressive quines ever created. It remains a frequently cited example of how far self-replicating code can be pushed within a high-level language.

## Historical Context

Released in 2010, the project was originally shared on the Japanese blog 'mamememo'. It highlights the era of Ruby's growing popularity for creative coding and metaprogramming. The script serves as a historical artifact of the Ruby community's fascination with pushing language boundaries through unconventional and highly creative software engineering projects.

## Legacy of Creative Coding

The Qlobe demonstrates that code can be both functional and artistic. By blending compression, geometry, and self-replication, it challenges the traditional definition of a program. It remains a benchmark for recreational programming, inspiring future generations of developers to explore the intersection of mathematics, data visualization, and the fundamental nature of code.

## Sources covering this story

- http://mamememo.blogspot.com/2010/09/qlobe.html — 

---

_Summary written by Brifing from the original reporting. Copyright in the original article belongs to its publisher; read the full piece at the link above._
