|
|
> You have an infinitely long line. Two robots are dropped on parachutes
> onto the line at random, and each drops its parachute (leaving it behind)
> where it lands. Your task is to crash the two robots into each other.
>
> Each robot runs the identical program starting at the beginning, and the
> parachutes are identical, and they are in all ways identical other than
> where they land, which is random.
>
> You have the following instructions available for programming the robots:
>
> Move the robot one step left.
>
> Move the robot one step right.
>
> Move the instruction pointer to a particular instruction (i.e., "goto")
>
> Skip the following instruction if you're standing on a parachute.
Wow that's a good one.
Given that both programs are identical, you'll need to use the fact that the
only difference in the "input" is that one robot has another parachute to
his left, and one has another parachute to his right.
Something like this should work (I think):
(spolier space)
.slow_loop
Move left
Move right
Move left
Skip_next_if_parachute
Goto slow_loop
.fast_loop
Move left
Goto fast_loop
Post a reply to this message
|
|