27TICKET OFFICE
The task
X brings a queue of 0, 1, and 2. For each, P must receive that number's ticket count so far.
Two clerks keep counts on request, and the office keeps the third.
The board
Key idea
Counters on request, one kept in B at the hub; ANY would take the next input instead of the reply.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
Each clerk keeps its count in B. So does the office.
Hint 2Show
Ask a clerk by sending it anything, then read its answer.
Hint 3Show
Read the answer from the clerk you asked.
Solution
Reveal the Full SolutionThe complete program for TICKET OFFICE. 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
JZ N
SUB 1
JZ O
OUT P3
IN P3
JMP F
O: MOV A, 1
OUT P2
IN P2
JMP F
N: MOV A, 1
ADD B
MOV B, A
F: OUT P1c1SC-2 standard
IN P0
ADD B
MOV B, A
OUT P0c2SC-2 standard
IN P0
ADD B
MOV B, A
OUT P0- CYCLES
- 445
- at par
- ENERGY
- 2340
- at par
- NODES
- 3
- at par
- INSTRUCTIONS
- 23
- at par