Signalworks

Saved games stay in this browser only.

About the game

Signalworks is a programming puzzle. Every level gives you a chip with an input port, IN, holding a stream of numbers, and an output port, OUT, that expects a particular sequence. In between is a text editor and a very small assembly language: you write the program that turns one into the other. When what comes out matches what was expected, the level passes and the game records how many cycles your program took.

Passing is only half of it. A cycle is one executed instruction, and two programs that give the same answer can take quite different numbers of cycles, so each level invites you to go back and find a shorter way. That is the part the game is built around.

Playing it here

Click Play and the first level appears: a single value waits on IN and you have to send it to OUT. Type your program in the Program box and press Run to watch the signal cross the board, or Step to advance one instruction at a time while the Trace and Registers panels show the instruction being executed, the accumulator, the program counter, the cycle count and both ports. Errors in your program are listed under the editor with their line number.

The language is deliberately small. MOV copies a value from a source to a destination (for example MOV IN OUT), ADD and SUB do arithmetic on the accumulator, JMP, JEZ and JNZ jump to a label (always, if the accumulator is zero, or if it is not), and NOP does nothing. The program wraps back to the top after its last line, so a short loop keeps going until the input runs out.

There are 8 levels, from passing a value straight through to adding, subtracting, keeping a running total, doubling, skipping zeros and stopping at a zero terminator. Your best cycle count for each level is saved in your browser. The share button copies a link that opens the same level with your score as the target to beat.

Controls

Input Action
Keyboard write the program in the editor
Run run the program, one instruction per tick
Step execute one instruction
Reset go back to the start of the run
Levels open the list of levels
Sound button turn the sound on or off

A few things worth knowing

Start from the smallest program. The first levels need one or two lines. Each level adds a single new idea, so build on what the previous one taught you.

Labels mark jump targets. Write a name followed by a colon on its own line, such as loop:, and then JNZ loop to go back to it.

Fewer lines is not always fewer cycles. A loop saves lines but costs a jump on every pass, so for a short input the straight-line version can be faster.

No account, no uploads. Everything runs in your browser and your scores stay on your device.

Credits and licence

Signalworks was made by Charlie Krug and is released under the MIT licence. The game is served as the author published it, built from the source in his repository, with a few changes of ours: the web fonts that were loaded from Google were replaced by the same two fonts, JetBrains Mono and Space Grotesk, included with the game (SIL Open Font License 1.1), and the footer links and a mention of other games were removed, so that nothing is requested from other websites. The source of this build, our patch and the build script are hosted with the game, and the licence texts are linked from this page.