A Calculator Running in Vanilla Doom

It is so very, very impressive that Danny Spencer was able to construct a working calculator inside of vanilla Doom — no mods required.

Cameron Coward
1 year agoGaming

If you’re tuned into gaming news, you’ve probably seen lots of examples of players creating logic structures in Minecraft, ranging from simple calculators to entire recreations of vintage computers. That’s possible because Minecraft includes conditional blocks right out of the box. That isn’t true of Doom, which was never meant for anything more complex than blasting baddies. That’s why it is so very, very impressive that Danny Spencer was able to construct a working calculator inside of vanilla Doom no mods required.

All digital computing, including that used for a digital calculator, is the result of Boolean algebra, which relies on logic gates. If you’ve taken computer science courses, you probably learned about the typical gates: AND, OR, XOR, and so on. An AND gate, for example, will output TRUE if (and only if) both inputs are TRUE. By chaining many gates together, you can perform calculations. A NAND gate is a universal gate, meaning you can use only NAND gates to recreate the full Boolean logic truth table. Modern transistors form NAND gates for this reason — if you have enough of them, they can calculate anything.

Knowing this, Spencer’s first step was to somehow build a NAND gate using only the objects and entities available in the vanilla (unmodified) Doom game. He knew that if he accomplished that, he’d be able to copy and paste that NAND gate as many times as necessary to build a working calculator.

Spencer built his Doom NAND gate as a small room with with two corridors blocked by doors on both sides. A monster starts inside the first corridor and represents electricity flowing through the logic gate. Buttons control whether a door opens or closes, and teleport pads on the other side of those doors move the monster to the next corridor or gate. So the positions of the switches (the inputs) control the ultimate destination of the monster (the output) on a binary path (TRUE or FALSE). One room feeds into the next, with the monster’s final location in the previous room controlling the state of the switches in the current room. That is a complete NAND gate. From there, Spencer just had to copy and past the room enough times to get the number of NAND gates necessary for calculations.

The player interacts with the calculator in a special control room with a bunch of input buttons. The first row of buttons 0-9 lets the player enter the first digit of the first number to add, and so on. Once the player enters both two digit numbers, the monsters start moving through their NAND gate rooms out of sight. After the adding completes, the result “displays” as a set of monsters standing in a grid to form the numerals.

Cameron Coward
Writer for Hackster News. Proud husband and dog dad. Maker and serial hobbyist. Check out my YouTube channel: Serial Hobbyism
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles