Lab 3.5: Row of Houses
In this project, you’ll use abstractions inside of abstractions to build a row of houses.

When you finish, make sure to Turn in your Project
Create a
draw squareblock that takes a size as input. Be sure to test it with different inputs.You learned how to create a block with an input on Lab 3 Page 3: Blocks with Inputs.

Click to see one way to build
draw squarewithout an input..png)
Using
drawsquare as an example of where to start, create and test adraw triangleblock that takes a size as input and draws an equilateral triangle.You learned about turning angles on Unit 1, Lab 3, Page 2, Angles and Turning.

Now, use
draw squareanddraw triangletogether to create adraw houseblocks that takes a size as input and draws a house shape: a square with a triangular shaped roof sitting on top.You might have to do some debugging to get the two shapes to connect properly.

Using a block inside another block is a form of abstraction.
Use your
draw houseblock together withrepeatto create adraw row of housesblock that draws a row of number attached houses (each of the same size) with each new one to the right of the previous.

Use your
draw row of housesblock together withrepeatto create adraw group of housesblock that draws a rows by cols amount of houses (each of the same size) in one place with each row below the previous row.

If There Is Time…
Houses aren’t really stuck next to each other like in the examples that we gave! Edit the
draw row of housesanddraw group of housesblock so that there are gaps between the houses.
Customize the look of your houses by editing the code of your
draw houseblock. Things that you can add to the houses include:Windows, doors, garages, greenery, etc.
Consider breaking it down first. e.g., create a block
draw windowthat only draws a window then add the block into thedraw houseblock.
Create a better way of generating groups of houses. Edit
draw group of housesso that it usespick randomto create a group of houses that can have houses missing (i.e. make it look more “natural”)
We learned about the
pick randomblock on Unit 1, Lab 2, Page 5: Adding Variety toGossip.It is a reporter block that reports a random number within the range of numbers that you specify.
Take It Further…
Use your
draw squareblock to create adraw flower with square petalsblock that will draw a flower with square petals with any specified number of petals of the specified size.

After you’ve worked on this for a bit, take a moment to look at what others have done. If you see something you like, think how you could use that idea in your program.
Now, draw a field of flowers and give each flower a different size, number of petals, and position.
You will need to use
.
Make sure to turn in your project! Turn in your Project