Skip to main content

Section 18.4 Program Implementation - 2

Now that rectangle is working, we can use it to write our next procedure. I will tackle drawWall next. This procedure will take the name of the turtle, set a color, and then draw a 300x200 rectangle.

Checkpoint 18.4.1.

    We want to write the code for the drawDoor procedure. Below is the code for it.
    def drawDoor(currentTurtle):
        ______________.fillcolor("black")
        rectangle(______________, 50, 100)
    
    What name belongs in the ______________?
  • turtleName
  • drawWall calls its parameter turtleName. But there is nothing named "turtle" in drawDoor.
  • turtle
  • rectangle calls its parameter turtle. But there is nothing named "turtle" in drawDoor.
  • currentTurtle
  • Correct.
You have attempted of activities on this page.