Episode 5 is spent on Interrupt Handler. It opens with the four top nodes already holding code, and Basket builds the rest of the program, watches it fail, and goes back to the puzzle text to find out why. Rewritten, it passes about twenty minutes in, and the rest of the video goes on making it shorter. The segment is passed when the video ends.
Four inputs, one output
The puzzle reads: "Read from IN.1 through IN.4. Write the input number when the value goes from 0 to 1. Two interrupts will never change in the same input cycle." Each top node sits under one input and already starts with "SAV" and "SUB UP," then jumps to FINE or ZERO labels and sends its own number down: "MOV 1, DOWN" under IN.1, "MOV 2, DOWN" under IN.2, and so on.
Below them, the IN.1 side gets "MOV UP, RIGHT" and the IN.4 side "MOV UP, LEFT," so everything flows to the two middle nodes. Those take values from the left, from above and from the right, with LEFT and UP labels and "JGZ" jumps to decide which one to pass on, and "MOV UP, NIL" to throw away the rest. A node near the bottom sends it all to OUT with "MOV UP, DOWN." The commentary is not sure it will fit: "may or may not work at all."
Right some of the time
On the first run, rows of the OUT column turn red. "So it was right some of the time, which is interesting." The commentary adds a breakpoint, steps through the program and watches values move between nodes. "I haven't really debugged anything like this." The first wrong value turns out to be a 3 where the game expects a 0, sent because IN.3 had just changed.
From 0 to 1, not any change
Rereading the instructions settles it: the number goes out "when the value goes from 0 to 1, not when it changes." The top nodes had been sending their number whenever an input changed. The rewrite takes most of ten minutes in nodes the commentary calls "really small program windows." Each top node now saves its value, subtracts the input from above, and jumps with "JLZ CHANGED" to send its number, or sends "MOV 0, DOWN" and uses "JGZ SETZERO" and "SWP" to keep track of the old value. "My brain hurts." The next run reads "TEST 1 PASSED IN 317 CYCLES," and the result screen shows the segment passed: 318 cycles, 9 nodes and 65 instructions. A friend's score has the same 9 nodes with fewer cycles and 46 instructions. "Way more lines of code, interesting."
Adding instead of jumping
Back in the editor, the commentary has an idea: every value is either a zero or one input's number, so the middle nodes can simply add them up. The left one becomes "MOV LEFT, ACC," "ADD UP," "MOV ACC, RIGHT," and the right one adds the left, the top and the right before "MOV ACC, DOWN." It passes again with 314 cycles and 54 instructions. The friend's line still has fewer instructions, "but we're closer."
Where it ends
The commentary looks at the jump commands in the top nodes for another way to cut lines and does not find one. "We'll keep it like this for now. It's pretty good-ish." One more run gives the same 314 and 54, the view goes back to the segment map, and the commentary ends the episode with Interrupt Handler passed.