S50CROSSTALK
The task
The bus handshake, every piece swapped about. Swaps stay inside a core.
X arrives at a and Y at c. P on a must receive X plus Y.
Q on c must receive X minus Y, and R on b X times Y.
The board
Key idea
Par is 11 swaps. Core a needs 2 instruction swaps and 2 operand swaps; core b needs 2 instruction swaps and 2 operand swaps; core c needs 2 instruction swaps and 1 operand swap. 8 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
Each value goes out on the bus twice, since two cores need it.
Hint 2Show
c speaks first while a listens, then a answers while c listens.
Hint 3Show
A core keeps its own value in B while it reads the other one.
Solution
Reveal the Full SolutionThe complete program for CROSSTALK. 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
OUT P0
MOV P2, A
IN B
IN B
ADD B
MOV A, P1
OUT P1
OUT P1bSC-2 standard
IN P0
MOV B, B
OUT A
IN P0
MUL P1cSC-2 standard
OUT P0
SUB P1
OUT P1
MOV B, A
IN P1
OUT P2
IN B11 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
a, swap the operandP2on line 2 withBon line 5. - In core
a, swap the operandBon line 3 withP1on line 6. - In core
a, swap the instructionOUTon line 1 withINon line 4. - In core
a, swap the instructionOUTon line 4 withADDon line 5. - In core
b, swap the operandBon line 2 withAon line 3. - In core
b, swap the operandBon line 3 withP0on line 4. - In core
b, swap the instructionOUTon line 3 withINon line 4. - In core
b, swap the instructionOUTon line 4 withMULon line 5. - In core
c, swap the operandP2on line 6 withBon line 7. - In core
c, swap the instructionOUTon line 1 withINon line 7. - In core
c, swap the instructionSUBon line 2 withOUTon line 6.
The finished program
Every tile back in place: the reference solution, which scores exactly par on every benchmark.
aSC-2 standard
IN P0
MOV B, A
IN P1
ADD B
OUT P2
MOV A, B
OUT P1
OUT P1bSC-2 standard
IN P0
MOV B, A
IN P0
MUL B
OUT P1cSC-2 standard
IN P0
OUT P1
OUT P1
MOV B, A
IN P1
SUB B
OUT P2- CYCLES
- 547
- at par
- ENERGY
- 4680
- at par
- NODES
- 3
- at par
- INSTRUCTIONS
- 20
- at par
- SWAPS
- 11
- at par