22SIGN SORTER
The task
Positive values from X go to P and negative ones to Q, in order.
Zeros go nowhere. The hub decides, the leaves deliver.
The board
Key idea
Demultiplex by sign; zeros are dropped.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
JG and JL test the sign of A. A value that is neither is zero.
Hint 2Show
A hub that writes to one pin leaves the other leaf waiting, and that is fine.
Hint 3Show
A dropped value is simply never written.
Solution
Reveal the Full SolutionThe complete program for SIGN SORTER. 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.
hSC-2 standard
T: IN P0
JG G
JL N
JMP T
G: OUT P1
JMP T
N: OUT P2c1SC-2 standard
IN P0
OUT P1c2SC-2 standard
IN P0
OUT P1- CYCLES
- 198
- at par
- ENERGY
- 1388
- at par
- NODES
- 3
- at par
- INSTRUCTIONS
- 11
- at par