· 5 min read

Three Coding-Related Games (Part 2)

This article was auto-translated from Chinese. Some nuances may be lost in translation.

Today, I’ll continue introducing a few programming-related games: TIS-100 and Turing Complete.

TIS-100

image10

This game shares a similar philosophy with A=B, which I introduced in the previous post.

The premise is that you have a TIS-100 computer equipped with an assembly-like syntax and 12 nodes. Each node has a register, and certain nodes can serve as inputs and outputs, somewhat similar to the concept of GPIO. The assembly language provided in the game is simplified—there are no complex addressing modes or interrupts.

Just like in other programming games, your goal is to solve various puzzles. However, since you’re writing in assembly, in terms of difficulty:

  • If you already understand basic assembly concepts: It will be easier than A=B. After all, A=B forces you to solve puzzles using a severely crippled syntax, whereas assembly doesn’t feel that restrictive.
  • If you have no background in assembly: It might feel just as hard as A=B. Grasping the core concepts of assembly takes some time.

image20

All the syntax and instructions for the game are documented in a reference manual PDF.

The game tracks stats such as cycle count, code length, and the number of nodes used, making it a great pastime for players who enjoy optimizing for the best possible solution.

This game has no tutorial! The barrier to entry is quite high for players with zero programming background. However, the game’s architecture is significantly streamlined; the actual number of instructions and specs you need to memorize is far smaller than in real assembly.

The problems themselves aren’t actually that complicated—for instance, “add input A and input B, then send the result to output A” or “multiply input A and input B and output the result.” Of course, assembly isn’t an insurmountable mountain. If you can pick it up and beat the game, you might already know more low-level concepts than half the software engineers out there, since not every engineer encounters assembly in their career.

Turing Complete

This is a game about building a CPU completely from scratch.

Your goal starts with the most fundamental logic gates, gradually constructing essential components like adders, multiplexers, and registers, until you step-by-step build a CPU. But it doesn’t stop once the CPU is built—you then write an instruction set for your CPU, assemble it into your own assembly language, and use that assembly to solve puzzles.

There’s a quote in the Steam trailer that I really like:

If you try to make such projects, unseen by others, as perfect as any human could, you’ll develop skills that other professionals don’t have

Of course, the CPU in the game is a heavily simplified model. Neither the semiconductor fabrication nor the circuit design reflects real-world complexities. For instance, basic modern features like branch prediction aren’t implemented. Still, this doesn’t diminish its value in helping us understand how a CPU works.

Many software engineers—unless they work in hardware or systems engineering—don’t necessarily know how a CPU operates under the hood or how to read assembly. If you’re willing to invest the time to clear every level in this game, you’ll definitely learn a lot of things that many software engineers don’t know.

The UI is primarily wire-routing based. Once you build a functional logic component, it becomes a reusable block that you can drop into subsequent levels.

As you progress deeper into the game, you unlock more and more components. The circuits in later stages grow increasingly complex, requiring significantly more components and wiring.

Turing Completeness

A major milestone in the game is achieving Turing completeness. Once you complete the “WORKING COMPUTER” level, you realize all the circuits you painstakingly assembled earlier were leading up to this exact moment. This stage requires you to fulfill several conditions:

  • Decode bits in the bytecode to determine which operation to execute: ADD, XOR, OR, etc.
  • Program Counter: Keeps track of where the program is currently executing.
  • Determine whether to execute a jump (branch to a specified address) based on condition bits: Implementing six conditions (greater than, less than, equal, always, never).
  • 5 registers.

At this point, you’ve essentially built a rudimentary CPU. Even though it runs entirely in software emulation, the sense of accomplishment when it works is immense.

Puzzle Solving

Next, the game asks you to write assembly code. You can define this assembly language yourself, which then maps down to machine code. Later levels challenge you to solve algorithmic puzzles using your assembly, such as computing modulo operations or navigating a maze.

Final Thoughts

The essence of programming has never been about syntax itself; it’s about the underlying logic and thought process.

Many people might ask: “If it’s not that different from coding, why not just go write real code?” My take is that games allow people to learn new things within a visually intuitive and streamlined environment. You don’t have to fiddle with configuration files, wrestle with an IDE, or learn how to configure a debugger. Lowering the cost of the feedback loop does wonders for the learning process.

Related Posts

Explore Other Topics