Doom, Using Regular Expressions
An audacious programming feat attempts to render and play Doom purely through the logic of regular expressions, highlighting the absurd limits of computation.
This article from Hackaday explores an incredibly unconventional and almost certainly impractical attempt to run the classic video game Doom using nothing but regular expressions. While the very idea sounds ludicrous, it serves as a fascinating thought experiment and a testament to the creative, sometimes chaotic, nature of software development. The project, if successful even in a limited capacity, would not aim for playability but rather to push the boundaries of what is conceptually possible with regex. Typically, regular expressions are used for pattern matching and string manipulation – powerful tools for text processing. Applying them to a task as visually and computationally complex as rendering a 3D environment and managing real-time game logic stretches their definition to breaking point. The core challenge lies in how regular expressions handle state and graphics. Doom, even in its retro glory, relies on changing pixel states, player input, and a complex game engine to update its world. Regular expressions, by design, are stateless; they evaluate an input string against a pattern. To "play" Doom, one would need to encode the entire game state (map, player position, health, enemy locations, object interactions) into a string, and then apply a series of regex transformations to simulate game logic. Each "frame" or "game tick" would involve rewriting this massive state string based on predefined regex rules that represent movement, combat, and rendering. For instance, a player movement could be represented by a regex pattern matching the player's current coordinates and replacing them with new ones. Similarly, rendering a simple wall might involve converting a numerical representation of a wall segment into ASCII art within the string. This would be an immense undertaking, likely resulting in an extremely slow, text-based, and highly abstracted version of Doom, far removed from its original graphical glory, but undeniably a monumental intellectual exercise in computer science absurdity. It would underscore the Turing completeness of various systems and the unexpected ways they can be coerced into tasks far beyond their initial design. The article would delve into the hypothetical regex patterns, the string encoding schemes, and the theoretical computational overhead, perhaps even showcasing a tiny, proof-of-concept animation.