25ROUND ROBIN
The task
P must receive 4 times each X value, plus 1, in order.
w1 is an SC-2L, a low power core: it takes 2 cycles an instruction but half the energy.
Collect results in the order you dealt them.
The board
Key idea
Deal values to two workers in turn and collect them in the same turn; w1 is a slow SC-2L, so it gets one turn in three.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
Either worker can do the whole job. Par needs both.
Hint 2Show
The dealer and the collector must agree on whose turn it is.
Hint 3Show
w1 is slow, so give it fewer turns: two values to w2 for each one to w1.
Solution
Reveal the Full SolutionThe complete program for ROUND ROBIN. 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
IN P0
OUT P2
IN P0
OUT P1
IN P0
OUT P2w1SC-2L low power
IN P0
ADD A
ADD A
ADD 1
OUT P1w2SC-2 standard
IN P0
ADD A
ADD A
ADD 1
OUT P1jSC-2 standard
IN P1
OUT P2
IN P0
OUT P2
IN P1
OUT P2- CYCLES
- 213
- at par
- ENERGY
- 1911
- at par
- NODES
- 4
- at par
- INSTRUCTIONS
- 22
- at par
Another way: Even turns
A second program that also passes. It beats par on ENERGY and INSTRUCTIONS and gives some back on CYCLES.
Strict turns: slower than par, since w1 holds up every other value, but it spends less energy.
hSC-2 standard
IN P0
OUT P1
IN P0
OUT P2w1SC-2L low power
IN P0
ADD A
ADD A
ADD 1
OUT P1w2SC-2 standard
IN P0
ADD A
ADD A
ADD 1
OUT P1jSC-2 standard
IN P0
OUT P2
IN P1
OUT P2- CYCLES
- 224
- over par
- ENERGY
- 1806
- under par
- NODES
- 4
- at par
- INSTRUCTIONS
- 18
- under par
Another way: One worker
A second program that also passes. It beats par on ENERGY, NODES, and INSTRUCTIONS and gives some back on CYCLES.
Correct but slow: every value through the first worker.
hSC-2 standard
IN P0
OUT P1w1SC-2L low power
IN P0
ADD A
ADD A
ADD 1
OUT P1jSC-2 standard
IN P0
OUT P2- CYCLES
- 433
- over par
- ENERGY
- 1521
- under par
- NODES
- 3
- under par
- INSTRUCTIONS
- 9
- under par