Syscall 2: Firmware, home

SignalChapter 5: Half duplex

36SPEED LIMIT

The task

P starts at 0 and follows X, but each step it moves by 10 at most.

For each value of X, send where P lands.

The board

The board of SPEED LIMIT2 cores: f and b. Inputs X; outputs P.fSC-2 15 LINESbSC-2 6 LINESP0P1P0P1XP
The board as the puzzle screen lays it out. Cyan pins read, lemon pins write, violet pins go both ways. On a narrow screen, scroll the board sideways to see all of it.

Key idea

Position at one end, target at the other; the step is clamped both ways and sent back.

Hints

Each hint goes a step further than the one before. Open them one at a time.

Hint 1Show

Let the right core keep the position and send it over before each step.

Hint 2Show

Work out the step on the left, keep it between -10 and 10, and send it back.

Hint 3Show

JG and JL after a SUB tell you which side of a limit you are on.

Solution

Reveal the Full SolutionThe complete program for SPEED LIMIT. Open it only when you want the answer.

The reference program

The game's own solution. It passes every test and scores exactly par on every benchmark.

fSC-2 standard

IN P1
MOV B, A
IN P0
SUB B
SUB 10
JG H
ADD 20
JL N
SUB 10
JMP O
H: MOV A, 10
JMP O
N: MOV A, -10
O: OUT P1

bSC-2 standard

OUT P0
MOV B, A
IN P0
ADD B
OUT P1
CYCLES
575
at par
ENERGY
3424
at par
NODES
2
at par
INSTRUCTIONS
19
at par