35COMMON GROUND
The task
P must receive the largest number that divides both X and Y. Each runs from 1 to 99.
Each core holds one of the two, and they talk over one wire.
The board
Key idea
A loop of rounds over one wire with a stop word; the gap goes back when the left value shrinks.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
Take the smaller from the larger until the two match. That is the answer.
Hint 2Show
When the left value must shrink, send the difference back.
Hint 3Show
Tell the left core when the two match, so it knows to send.
Solution
Reveal the Full SolutionThe complete program for COMMON GROUND. 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.
leftSC-2 standard
S: IN P0
T: OUT P1
MOV B, A
IN P1
JZ E
JG T
XCH A, B
JMP T
E: XCH A, B
OUT P2rightSC-2 standard
S: IN P0
T: MOV B, A
IN P1
SUB B
OUT P1
JZ S
JL M
MOV A, B
JMP T
M: NEG
JMP T- CYCLES
- 5926
- at par
- ENERGY
- 50744
- at par
- NODES
- 2
- at par
- INSTRUCTIONS
- 21
- at par