S24SCATTERSHOT
The task
One hub feeds three answers, and every piece is out of place.
Send each X three ways: times 3 to P, negated to Q, and minus 10 to R.
The board
Key idea
Par is 5 swaps. Core h needs 2 instruction swaps and 3 operand swaps. 4 of them trade two tiles that hold each other's places; look for those first, since one swap mends both.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
The hub can write one value to several pins before it changes it.
Hint 2Show
SUB 10 changes A, so it comes after the copies that need X as it was.
Hint 3Show
MOV B, A keeps a copy, and ADD B twice makes three of it.
Solution
Reveal the Full SolutionThe complete program for SCATTERSHOT. Open it only when you want the answer.
The board as dealt
This is the arrangement the game deals. Framed tiles are the ones out of place.
hSC-2 standard
OUT P2
OUT P3
IN P0
OUT P1
SUB 10c1SC-2 standard
IN P0
MOV B, A
ADD B
ADD B
OUT P1c2SC-2 standard
IN P0
NEG
OUT P15 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
h, swap the operandP2on line 1 withP0on line 3. - In core
h, swap the operandP3on line 2 withP1on line 4. - In core
h, swap the operandP3on line 4 with10on line 5. - In core
h, swap the instructionOUTon line 1 withINon line 3. - In core
h, swap the instructionOUTon line 4 withSUBon line 5.
The finished program
Every tile back in place: the reference solution, which 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
- SWAPS
- 5
- at par