S16WRONG NUMBER
The task
The operator's code is here, its pieces swapped. Put them back.
Each locked caller sends two values and waits for their sum.
The board
Key idea
Par is 3 swaps. Core op needs 2 instruction swaps and 1 operand swap. 2 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
IN ANY takes the first caller with a value waiting.
Hint 2Show
LAST is the pin ANY used, so IN LAST and OUT LAST stay with that caller.
Hint 3Show
MOV B, A keeps the first value while A reads the second.
Solution
Reveal the Full SolutionThe complete program for WRONG NUMBER. 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.
opSC-2 standard
OUT ANY
MOV B, A
IN LAST
IN LAST
ADD B3 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
op, swap the operandLASTon line 4 withBon line 5. - In core
op, swap the instructionOUTon line 1 withINon line 4. - In core
op, swap the instructionOUTon line 4 withADDon line 5.
The finished program
Every tile back in place: the reference solution, which scores exactly par on every benchmark.
opSC-2 standard
IN ANY
MOV B, A
IN LAST
ADD B
OUT LAST- CYCLES
- 126
- at par
- ENERGY
- 380
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 5
- at par
- SWAPS
- 3
- at par