BasketMC

Differential Converter, Episode 4: TIS-100

  • Published on

Episode 4 starts without a new puzzle. Basket goes back to segments that already pass and tries to cut their cycle counts by splitting the work between nodes. Only Signal Amplifier gets faster. The second half opens Interrupt Handler, and the video ends with code in four nodes that has not been run.

Taking turns

Differential Converter passed in Episode 1 at 240 cycles. The commentary wonders whether the cycle count "is just how long the program is running." On a copy, the middle node under IN.A gets "MOV UP, DOWN" and "MOV UP, RIGHT," so the values take turns going two ways. On the first test run the second value in both OUT.P and OUT.N turns red. "The thing I was going to try doesn't work for this program, never mind." The copy is erased.

The Differential Converter screen running test 1 on a copy of the program: the second value in both the OUT.P and OUT.N output columns is shown in red, and the middle node under IN.A holds "MOV UP, DOWN" and "MOV UP, RIGHT"

Twice as fast

The same idea goes into a copy of Signal Amplifier. One node hands values alternately down and right, and two nodes each double theirs with "ADD ACC" before the results rejoin on the way to OUT.A. Every test passes in 84 cycles, down from 160 in Episode 1, with 6 nodes and 12 instructions, which ties the best of the friends' scores. "So that's the trick is, the cycles is how long it takes to run."

The Signal Amplifier screen reading "Test 1 passed in 84 cycles" and "Test 2 passed in 84 cycles" while test 3 runs: a node with "MOV UP, DOWN" and "MOV UP, RIGHT" splits the input between two nodes that each hold "ADD ACC", and both feed the path down to OUT.A

More cycles, not fewer

Differential Converter gets a second try, with the subtraction mirrored on both sides of the grid. It passes, but in 278 cycles with 6 nodes and 20 instructions. "That was actually more cycles than the original program." A copy of Signal Multiplexer follows, its labeled jump code repeated in two more nodes, until the commentary says "I changed my mind. I don't like this," and the program is erased.

Interrupt Handler

Back on the segment map, the commentary notices that Simple Sandbox already says nominal. Interrupt Handler is new. Its panel 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."

Basket starts in the node under IN.1 with "SWP", "SAV" and "SUB UP." Typing "JEZ FINE" before that label exists brings up a red "Undefined label" warning. "If the value is zero, that means that the number didn't change." Then: "I have to output a zero if nothing has changed." In the finished node, FINE sends "MOV 0, DOWN." Otherwise the node sends "MOV 1, DOWN," sets ACC to 1 or, through a ZERO label, to 0, and jumps back to START.

The Interrupt Handler editor with its instructions in the top left, four input columns of ones and zeros, and the node under IN.1 holding "SWP", "SAV", "SUB UP" and "JEZ FINE" under a red "Undefined label" warning

Where it ends

The node is copied into all four nodes under the inputs, each sending its own number, "MOV 1, DOWN" through "MOV 4, DOWN." The commentary says the next step is to work out which value is the highest, keep that and send it down: "I'm gonna ponder that." The program is not run before the video cuts to the end card, so Interrupt Handler is still unsolved.

The Interrupt Handler editor with the same labeled program in each of the four top nodes under IN.1 to IN.4, with START, ZERO and FINE labels, each sending its own number down with "MOV 1, DOWN" through "MOV 4, DOWN", while the rows below are still empty