Credit: Chris Piech
Handouts: KarelReference
Worked Examples: UN Karel, Banish Winter
Day1: hospital_karel.py
Countries around the world are dispatching hospital-building robots to make sure anyone who gets sick can be treated. They have decided to enlist Karel robots. Your job is to program those robots.
Karel begins at the left end of a row that might look like this:
Each beeper in the figure represents a pile of supplies. Karel’s job is to walk along the row and build a new hospital in the places marked by each beeper. Each hospital should look exactly like the picture below (two columns of three beepers):
The new hospital should have their corner at the point at which the pile of supplies was left. At the end of the run, Karel should be at the end of the row having created a set of hospitals. For the initial conditions shown, the result would look like this:
Keep in mind the following information about the world:
Write a program to implement the Hospital Building Karel project. Remember that your program should work for any world that meets the above conditions.