S01CROSSED WIRES
The task
The code that solves this is all here, in the wrong places. Swap the pieces back.
Every value from X must reach P raised by 25.
The board
Key idea
Par is 2 swaps. Core a needs 1 instruction swap and 1 operand swap. Every one of them trades two tiles that hold each other's places, so each swap mends two.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
Instructions swap with instructions and operands with operands, inside one core.
Hint 2Show
IN replaces A and OUT sends A as it is, so the ADD goes after the IN and before the OUT.
Hint 3Show
Core b only passes values along: IN P0, then OUT P1.
Solution
Reveal the Full SolutionThe complete program for CROSSED WIRES. 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 P0
OUT P1
ADD 25bSC-2 standard
IN P0
OUT P12 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
a, swap the operandP1on line 2 with25on line 3. - In core
a, swap the instructionOUTon line 2 withADDon 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
ADD 25
OUT P1bSC-2 standard
IN P0
OUT P1- CYCLES
- 159
- at par
- ENERGY
- 1170
- at par
- NODES
- 2
- at par
- INSTRUCTIONS
- 5
- at par
- SWAPS
- 2
- at par