Question: We are going to walk you through a process that shows you the benefit of thinking about programming tasks in terms of writing functions. Over

We are going to walk you through a process that shows you the benefit of thinking about programming tasks in terms of writing functions.

  • Over the next 3 levels we are going to write a program that draws the figure shown at right which sort of looks like a jagged diamond shape.We are going to walk you through a process that shows you

  • If you look at this image you might recognize elements that repeat: this is a 4-sided figure, and each side is made up of some zig-zag steps.

  • We're going to break the programming down into useable parts and then use those parts as building blocks to make this more complex drawing.

  • First let's define a function that draws just one of these zig-zag steps. We've started you out with a definition of right() that you can use...

Do This:

Define a function named function drawStep() which makes the turtle move forward and left as shown.

Note: at the end the turtle should be facing the same direction it started.

the benefit of thinking about programming tasks in terms of writing functions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!