26DIRECTORY
The task
For each index 0 to 5 on X, P must receive that entry of the directory.
Entries 0 to 2 sit in the left drawer, 3 to 5 in the right. Each counts from 0.
The board
Key idea
Request and reply to two locked lookup tables; the right one counts from 0.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
A drawer reads an index on its wire and answers on the same wire.
Hint 2Show
Ask first, then read the answer. Both ends writing at once is a HEAD ON.
Hint 3Show
The right drawer's 0 is entry 3.
Solution
Reveal the Full SolutionThe complete program for DIRECTORY. 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
SUB 3
JL L
OUT P2
IN P2
OUT P3
JMP T
L: ADD 3
OUT P1
IN P1
OUT P3- CYCLES
- 527
- at par
- ENERGY
- 1634
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 11
- at par