Syscall 2: Firmware, home

SignalChapter 3: Chains and rings

13PASSING PLACE

The task

P must receive X minus Y, and Q must receive Y minus X.

The streams enter at opposite ends of a two way corridor and meet in the middle.

The board

The board of PASSING PLACE3 cores: c0, c1, and c2. Inputs X and Y; outputs P and Q.c0SC-2 15 LINESc1SC-2 15 LINESc2SC-2 15 LINESP0P1P2P0P1P0P1P2XQYP
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

Two streams cross in a bi corridor; one side must wait or it is HEAD ON.

Hints

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

Hint 1Show

The middle core is the only place both values meet.

Hint 2Show

Each end sends its value in, then waits for the answer.

Hint 3Show

If an end waits for the answer before it sends, the middle core waits forever.

Solution

Reveal the Full SolutionThe complete program for PASSING PLACE. 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.

c0SC-2 standard

IN P0
OUT P2
IN P2
OUT P1

c1SC-2 standard

IN P1
MOV B, A
IN P0
SUB B
OUT P1
NEG
OUT P0

c2SC-2 standard

IN P1
OUT P0
IN P0
OUT P2
CYCLES
432
at par
ENERGY
3510
at par
NODES
3
at par
INSTRUCTIONS
15
at par