5MIXER
The task
Add each value from X to the matching value from Y and send the sum to P.
Both streams meet at the core on the right.
The board
Key idea
Merging two streams: MOV B, A one, IN the other, ADD B.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
Every core also has a register B. MOV B, A copies A into B, and XCH swaps A and B.
Hint 2Show
IN always reads into A, so move the first value out of the way before the second read.
Hint 3Show
ADD B adds B to A. The two left cores only pass values along.
Solution
Reveal the Full SolutionThe complete program for MIXER. Open it only when you want the answer.
The reference program
The game's own solution. It passes every test and scores exactly par on every benchmark.
C2 keeps X in B, reads Y, and adds.
c0SC-2 standard
IN P0
OUT P1c1SC-2 standard
IN P0
OUT P1c2SC-2 standard
IN P0
MOV B, A
IN P1
ADD B
OUT P2- CYCLES
- 237
- at par
- ENERGY
- 2106
- at par
- NODES
- 3
- at par
- INSTRUCTIONS
- 9
- at par