Monday, September 6, 2010

Parachuting robots

Two identical robots living in flatland parachute from the sky.  Each one falls somewhere an on infinite number line.  They each leave their parachutes on the ground and start walking around.

For some reason, this puzzle brings to mind an image of a para-bomb, from one of the Super Mario Brothers games.

When each robot lands, it executes a program that tells it when to go left or right and under what conditions.  Each robot has an identical program.  Neither robot can tell which direction the other robot is just by looking. The goal is to have these two robots meet.

Write a program that will make this happen.  You don't need to know any programming, just write it in English or pseudocode.

See the solution