S32TALL ORDER
The task
The order desk and the stock room, swapped about. Swaps stay inside a core.
Each value of Y is an order for that many values of X, from 1 to 3.
P must receive the sum of each order.
The board
Key idea
Par is 6 swaps. Core s needs 4 instruction swaps and 2 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 desk passes the count to the stock room and waits for the sum on the same wire.
Hint 2Show
JRX A jumps ahead A lines, into a run of jumps and reads.
Hint 3Show
A count of 3 falls past both jumps and reads three times.
Solution
Reveal the Full SolutionThe complete program for TALL ORDER. 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.
sSC-2 standard
T: MOV A, 0
MOV B, A
JMP B
IN P0
IN A1
JRX A2
OUT P0
ADD B
MOV B, A
A2: IN P0
ADD B
MOV B, A
A1: IN A
ADD P1
JMP P1dSC-2 standard
IN P0
OUT P1
IN P1
OUT P26 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
s, swap the operandBon line 3 withP1on line 14. - In core
s, swap the operandP0on line 4 withAon line 13. - In core
s, swap the instructionJMPon line 3 withINon line 5. - In core
s, swap the instructionINon line 4 withJRXon line 6. - In core
s, swap the instructionINon line 6 withJMPon line 15. - In core
s, swap the instructionOUTon line 7 withINon line 15.
The finished program
Every tile back in place: the reference solution, which scores exactly par on every benchmark.
sSC-2 standard
T: MOV A, 0
MOV B, A
IN P1
JRX A
JMP A1
JMP A2
IN P0
ADD B
MOV B, A
A2: IN P0
ADD B
MOV B, A
A1: IN P0
ADD B
OUT P1dSC-2 standard
IN P0
OUT P1
IN P1
OUT P2- CYCLES
- 271
- at par
- ENERGY
- 1654
- at par
- NODES
- 2
- at par
- INSTRUCTIONS
- 19
- at par
- SWAPS
- 6
- at par