98ROUTE NUMBER
The task
a reads X and Y and shares a bus with b and c. Y is 0 or 1 and says where its X goes.
P, on b, must receive each X whose Y is 0, and Q, on c, each X whose Y is 1.
The board
Key idea
Y names the reader for each X: b steps off the bus so c can take an X meant for it.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
b is farther left, so b takes every value it reads before c can.
Hint 2Show
a can send Y first, so b knows whether the X after it is for b or for c.
Hint 3Show
When the X is for c, b must stay off the bus until c has it.
Solution
Reveal the Full SolutionThe complete program for ROUTE NUMBER. 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.
aSC-2 standard
IN P1
OUT P2
IN P0
OUT P2bSC-2 standard
S: IN P0
JZ K
NOP
JMP S
K: IN P0
OUT P1cSC-2 standard
IN P0
OUT P1- CYCLES
- 237
- at par
- ENERGY
- 2088
- at par
- NODES
- 3
- at par
- INSTRUCTIONS
- 12
- at par