Syscall 2: Firmware, home

SignalChapter 5: Half duplex

33ONE LANE BRIDGE

The task

Each step, Z picks a way across. On 0, X crosses to Q. On 1, Y crosses to P.

The value that does not cross that step is thrown away.

The board

The board of ONE LANE BRIDGE2 cores: left and right. Inputs X, Y, and Z; outputs P and Q.leftSC-2 15 LINESrightSC-2 15 LINESP0P1P2P3P0P1P2XZYPQ
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

A direction word decides who writes next; the waiting side drains its stream.

Hints

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

Hint 1Show

Only the left core sees Z, so tell the right core which way each step goes.

Hint 2Show

Every step uses one X and one Y, so drop the one that stays.

Hint 3Show

The right core must not write until it knows it is its turn.

Solution

Reveal the Full SolutionThe complete program for ONE LANE BRIDGE. 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.

leftSC-2 standard

T: IN P1
OUT P2
JNZ H
IN P0
OUT P2
JMP T
H: IN P2
OUT P3
IN P0

rightSC-2 standard

T: IN P1
JNZ H
IN P1
OUT P2
IN P0
JMP T
H: IN P0
OUT P1
CYCLES
375
at par
ENERGY
2552
at par
NODES
2
at par
INSTRUCTIONS
17
at par