13PASSING PLACE
The task
P must receive X minus Y, and Q must receive Y minus X.
The streams enter at opposite ends of a two way corridor and meet in the middle.
The board
Key idea
Two streams cross in a bi corridor; one side must wait or it is HEAD ON.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
The middle core is the only place both values meet.
Hint 2Show
Each end sends its value in, then waits for the answer.
Hint 3Show
If an end waits for the answer before it sends, the middle core waits forever.
Solution
Reveal the Full SolutionThe complete program for PASSING PLACE. 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.
c0SC-2 standard
IN P0
OUT P2
IN P2
OUT P1c1SC-2 standard
IN P1
MOV B, A
IN P0
SUB B
OUT P1
NEG
OUT P0c2SC-2 standard
IN P1
OUT P0
IN P0
OUT P2- CYCLES
- 432
- at par
- ENERGY
- 3510
- at par
- NODES
- 3
- at par
- INSTRUCTIONS
- 15
- at par