S44PILEUP
The task
A four stage line, each stage swapped about. Swaps stay inside a core.
Square X, take 7 away, square that, take 20 away, multiply by 3, and take 1 away.
P must receive the result for each X.
The board
Key idea
Par is 8 swaps. Core c needs 3 instruction swaps and 4 operand swaps; core d needs 1 instruction swap. 3 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
Each core does some of the steps to every value, in the order the brief gives them.
Hint 2Show
MUL A squares A. A number after MUL or SUB says how much.
Hint 3Show
c does three steps: square, take 20 away, then multiply by 3.
Solution
Reveal the Full SolutionThe complete program for PILEUP. 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.
aSC-1 lite
IN P0
MUL A
OUT P1bSC-2L low power
IN P0
SUB 7
OUT P1cSC-2 standard
OUT P1
SUB 3
IN P0
MUL 20
MUL AdSC-1 lite
SUB P0
IN 1
OUT P18 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
c, swap the operandP1on line 1 withP0on line 3. - In core
c, swap the operand3on line 2 withAon line 5. - In core
c, swap the operandP1on line 3 with20on line 4. - In core
c, swap the operandP1on line 4 with3on line 5. - In core
c, swap the instructionOUTon line 1 withINon line 3. - In core
c, swap the instructionSUBon line 2 withMULon line 5. - In core
c, swap the instructionOUTon line 3 withSUBon line 5. - In core
d, swap the instructionSUBon line 1 withINon line 2.
The finished program
Every tile back in place: the reference solution, which scores exactly par on every benchmark.
aSC-1 lite
IN P0
MUL A
OUT P1bSC-2L low power
IN P0
SUB 7
OUT P1cSC-2 standard
IN P0
MUL A
SUB 20
MUL 3
OUT P1dSC-1 lite
IN P0
SUB 1
OUT P1- CYCLES
- 287
- at par
- ENERGY
- 2223
- at par
- NODES
- 4
- at par
- INSTRUCTIONS
- 14
- at par
- SWAPS
- 8
- at par