Prize37 Chapter 3, Exercise 1 A boat going down a lock Task Sketch the five steps for a boat going down through a lock, starting with the chamber full. For each step say what the boat does and whether the top gates, bottom gates and paddles are open or shut. Then write the same list in Python and run it. Code (run with Python) steps = [ ("Boat waits above; chamber is full", "top gates open", "all paddles shut"), ("Boat enters, top gates close", "top gates shut", "all paddles shut"), ("Open bottom paddles", "top gates shut", "bottom paddles open"), ("Chamber empties to the lower level", "top gates shut", "bottom paddles open"), ("Open bottom gates, boat leaves", "bottom gates open", "bottom paddles open"), ] for i, (what, gates, paddles) in enumerate(steps, 1): print(i, what, "|", gates, "|", paddles) Output (exactly as printed) 1 Boat waits above; chamber is full | top gates open | all paddles shut 2 Boat enters, top gates close | top gates shut | all paddles shut 3 Open bottom paddles | top gates shut | bottom paddles open 4 Chamber empties to the lower level | top gates shut | bottom paddles open 5 Open bottom gates, boat leaves | bottom gates open | bottom paddles open Answer The boat enters the full chamber, the top gates are shut behind it, and the bottom paddles let the water out until the chamber matches the lower pound. Only then do the bottom gates swing open. It is the going-up cycle in reverse, using the opposite paddles. In practice the paddles are shut again after the boat leaves, and the bottom paddles are opened slowly so the boat is not dropped suddenly (check).