20BROADCAST
The task
Send each X value three ways: times 3 to P, negated to Q, and minus 10 to R.
Only the hub can read X.
The board
Key idea
One value, three uses; the leaf that triples needs two copies.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
A hub can write the same A to as many pins as it likes.
Hint 2Show
ADD A doubles a value, but a third copy has to come from somewhere.
Hint 3Show
MOV B, A keeps a copy in B, and ADD B can add it as often as you like.
Solution
Reveal the Full SolutionThe complete program for BROADCAST. 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 P1
OUT P2
SUB 10
OUT P3c1SC-2 standard
IN P0
MOV B, A
ADD B
ADD B
OUT P1c2SC-2 standard
IN P0
NEG
OUT P1- CYCLES
- 313
- at par
- ENERGY
- 3042
- at par
- NODES
- 3
- at par
- INSTRUCTIONS
- 13
- at par
Another way: Three reads
A second program that also passes, by a different road, at a cost on CYCLES, ENERGY, and INSTRUCTIONS.
Three copies, each added in turn.
hSC-2 standard
IN P0
OUT P1
OUT P1
OUT P1
OUT P2
SUB 10
OUT P3c1SC-2 standard
IN P0
MOV B, A
IN P0
ADD B
MOV B, A
IN P0
ADD B
OUT P1c2SC-2 standard
IN P0
NEG
OUT P1- CYCLES
- 508
- over par
- ENERGY
- 4212
- over par
- NODES
- 3
- at par
- INSTRUCTIONS
- 18
- over par