S14QUIET DROP
The task
A short one. The three lines are out of order.
Every value from X must reach P reduced by 1.
The board
Key idea
Par is 2 swaps. Core a needs 2 operand swaps. One of them trades two tiles that hold each other's places; look for it 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
SUB 1 takes one from A. It sits between IN and OUT.
Hint 2Show
IN replaces A, so a subtract before the read is lost.
Hint 3Show
The core repeats from the top. One pass of the three lines is the whole loop.
Solution
Reveal the Full SolutionThe complete program for QUIET DROP. 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-2 standard
IN P1
SUB P0
OUT 12 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
a, swap the operandP1on line 1 withP0on line 2. - In core
a, swap the operandP1on line 2 with1on line 3.
The finished program
Every tile back in place: the reference solution, which scores exactly par on every benchmark.
aSC-2 standard
IN P0
SUB 1
OUT P1- CYCLES
- 157
- at par
- ENERGY
- 702
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 3
- at par
- SWAPS
- 2
- at par