2.1. Whipping Ice
Remember Indiana Jones and his bullwhip? In these problems, Indy must overcome a series of obstacles to reach his goal. Indy stands on a board resembling a skateboard but that cannot tilt. Under the chassis are four metal ball bearings on universal swivels. He travels over a smooth frozen lake that has narrow wooden poles sticking up and out of the ice.
Here are the rules:
If he is going in a given direction and has not wrapped the whip around any pole, then he will keep going in a straight line. He cannot otherwise force the chassis to turn.
The whip is light, so throwing it in any direction does not change his direction materially.
He can unwhip a whip from a pole at will.
He can pull on the whip or just let it rotate him, but pushing the whip has no effect.
2.1.1. Warm-Up
In Figure 1-2, you see a challenge for Indy to get from one end of a corridor that is partly blocked by two barriers to the other end. Assuming Indy can approach the corridor at any angle, how can he reach the other end without touching any barriers?
Figure 2.1. How can Indy use his whip to navigate from the bottom of the corridor to the top without hitting the barriers or the sides? Assume ...
Get Puzzles for Programmers and Pros now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.