65DETOUR
The task
P must receive 100 minus 8 times each X value.
A value can take the short road through k or the long road through l1, l2, and l3.
k is a standard core. s, j, l1, l2, and l3 are SC-1s: register A only, 8 lines.
The board
Key idea
A long road of cheap cores costs less energy and runs faster than a short road through one standard core, at more nodes.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
A long road of cheap cores can cost less energy than a short road through one standard core.
Hint 2Show
One road takes fewer NODES. Both roads at once run in fewer CYCLES.
Hint 3Show
If s deals the roads in turn, j must collect them in the same turn.
Solution
Reveal the Full SolutionThe complete program for DETOUR. 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.
sSC-1 lite
IN P0
OUT P2l1SC-1 lite
IN P0
NEG
ADD A
OUT P1l2SC-1 lite
IN P0
ADD A
ADD A
OUT P1l3SC-1 lite
IN P0
ADD 100
OUT P1jSC-1 lite
IN P1
OUT P2- CYCLES
- 207
- at par
- ENERGY
- 1755
- at par
- NODES
- 5
- at par
- INSTRUCTIONS
- 15
- at par
Another way: Both roads
A second program that also passes. It beats par on CYCLES and gives some back on ENERGY, NODES, and INSTRUCTIONS.
S deals the roads in turn and j collects in the same turn. Fewer CYCLES than par, at more energy, more NODES, and more INSTRUCTIONS.
sSC-1 lite
IN P0
OUT P1
IN P0
OUT P2kSC-2 standard
IN P0
NEG
ADD A
ADD A
ADD A
OUT P1l1SC-1 lite
IN P0
NEG
ADD A
OUT P1l2SC-1 lite
IN P0
ADD A
ADD A
OUT P1l3SC-1 lite
IN P0
ADD 100
OUT P1jSC-1 lite
IN P0
ADD 100
OUT P2
IN P1
OUT P2- CYCLES
- 186
- under par
- ENERGY
- 1875
- over par
- NODES
- 6
- over par
- INSTRUCTIONS
- 26
- over par
Another way: Short road
A second program that also passes. It beats par on NODES and INSTRUCTIONS and gives some back on CYCLES and ENERGY.
The short road. Fewer NODES and INSTRUCTIONS than par, but the work costs twice the energy on k and the one core sets the pace.
sSC-1 lite
IN P0
OUT P1kSC-2 standard
IN P0
NEG
ADD A
ADD A
ADD A
ADD 100
OUT P1jSC-1 lite
IN P0
OUT P2- CYCLES
- 317
- over par
- ENERGY
- 2106
- over par
- NODES
- 3
- under par
- INSTRUCTIONS
- 11
- under par