The Hurdle Race Problem

Major Programming Topics

- Jeroo methods
- while structure
- if-else structure

This problem has been adapted from the Super-Duper Steeplechase problem (exercise 10 at the end of chapter 5) in “Karel the Robot, 2nd edition” by Richard Pattis, Jim Roberts, and Mark Stehlik.

Statement of the Problem
A Jeroo starts at the southwest corner of the island, location (23,0), facing East with no flowers. There is a flower somewhere east of the Jeroo. There are hurdles, represented by nets, between the Jeroo and the flower. Each hurdle is a rectangular arrangement of nets with its base along the Southern Sea. The height and width of each hurdle is unknown. The number of hurdles and the spacing between the hurdles is unknown. There is at least one row of empty cells along the top and sides of each hurdle. There are no water features and no other Jeroos on the island. The only nets are those that define the hurdles. The goal of this program is to have the Jeroo jump all of the nets, pick the flower, and stop. A representative island is shown below.