93SECOND CHANCE
The task
a reads X onto a bus it shares with b and c.
P, on b, must receive the values of X above 0, and Q, on c, the rest, each in order.
The board
Key idea
B keeps what is above 0 and writes the rest back for c, but a writes its next value first unless it rests.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
b reads first, so it can send on what is above 0 and write the rest back on the bus for c.
Hint 2Show
If a has written its next value by then, c takes a's: the one farther left goes first.
Hint 3Show
a can wait a cycle after each value, so that b's goes out first.
Solution
Reveal the Full SolutionThe complete program for SECOND CHANCE. 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 P0
OUT P1
NOPbSC-2 standard
S: IN P0
JG K
OUT P0
JMP S
K: OUT P1cSC-2 standard
IN P0
OUT P1- CYCLES
- 182
- at par
- ENERGY
- 1764
- at par
- NODES
- 3
- at par
- INSTRUCTIONS
- 10
- at par