Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1.81 KB

File metadata and controls

39 lines (24 loc) · 1.81 KB

Yellow brick road

In this lab, you will use nested loops to draw a yellow brick road using as little scripting as possible.

Part 1: Brick by brick

  1. Write a program to draw a single 20x10 "brick" in the lower left corner of the stage when the green flag is clicked.

  2. Modify your program to draw two bricks side by side. The bricks should share a short edge, like this:

    Two yellow bricks

  3. Now modify your program again to build a full row of bricks across the entire length of the stage. Use a loop to keep your script as concise as possible. Remember that the stage is 480 pixels wide.

Part 2: Build a road

  1. Build a row of bricks, add scripting to build a second row above the first row. The bricks in the second row should share a long edge with those in the first row, but should be "offset" so that the ends of the second row bricks are at the middle of the first row bricks, like this:

    Offset yellow bricks

  2. Modify your program to build four total rows, alternating back and forth between the "regular" and "offset" rows. Use nested loops to keep your script concise.

  3. Finish off the road by building alternating rows all the way to the top of the stage. Your final road should look like this:

    Brick Road

  4. Save your project as Lab2.2.

Grading rubric

Criteria Points
1.2 2 bricks bottom left 0.5
1.3 row on bottom 0.5
2.1 second row offset 0.5
3.3 complete road 0.5
Uses at least one loop 0.5
Minimum redundancy in all 0.5
Total 3.0