This classic puzzle can be found on many different websites (Spoilers!). It seems to originate from a Microsoft interview question. This is an interactive version of the puzzle where you can immediately try your ideas.
Two robots are to be parachuted onto random locations on an infinite line. When they land, their parachutes detach and remain where they are. The robots may be programmed from the following instruction set:
|Go left one unit|
|Go right one unit|
|Skip next instruction if there is a parachute here|
|Go to label|
Each of these instruction can be prepended by an optional label (
Your goal is to program the robots to meet (collide). They both run the same code.