S30BACKCHAT
The task
Two cores on one wire, their pieces swapped. Swaps stay inside a core.
P on the left must receive X plus Y. Q on the right must receive Y minus X.
The board
Key idea
Par is 6 swaps. Core left needs 2 operand swaps; core right needs 3 instruction swaps and 1 operand swap. 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 right core speaks first and the left one listens, then they trade places.
Hint 2Show
The left core sends back the sum, not what it read.
Hint 3Show
From the sum, taking Y away twice and flipping the sign leaves Y minus X.
Solution
Reveal the Full SolutionThe complete program for BACKCHAT. 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.
leftSC-2 standard
IN P2
MOV A, B
IN P0
ADD B
OUT P1
OUT P1rightSC-2 standard
OUT P0
OUT P1
IN A
MOV B, B
IN P1
ADD A
NEG
SUB P26 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
left, swap the operandP2on line 1 withP1on line 5. - In core
left, swap the operandAon line 2 withBon line 2. - In core
right, swap the operandBon line 4 withAon line 6. - In core
right, swap the instructionOUTon line 1 withINon line 3. - In core
right, swap the instructionOUTon line 3 withADDon line 6. - In core
right, swap the instructionOUTon line 6 withSUBon line 8.
The finished program
Every tile back in place: the reference solution, which scores exactly par on every benchmark.
leftSC-2 standard
IN P1
MOV B, A
IN P0
ADD B
OUT P2
OUT P1rightSC-2 standard
IN P0
OUT P1
ADD A
MOV B, A
IN P1
SUB B
NEG
OUT P2- CYCLES
- 547
- at par
- ENERGY
- 3276
- at par
- NODES
- 2
- at par
- INSTRUCTIONS
- 14
- at par
- SWAPS
- 6
- at par