You are on page 1of 4

Part 2: Level 10 drawing a row of houses

A house looks like this:

It consists of an equilateral triangle on top of a square. The sides of the square are the same length as on top
of the triangle.

The instructions break down the process for drawing a row of houses.

1. First, draw a square using a repeat loop, like in Level 1. By default, the repeat loop does something 10
times; you can alter this by selecting the ‘10’ in the repeat loop and typing in a different number.
2. Next, draw a triangle on top of it. Use a repeat loop again. You may need to reposition the turtle and
angle it before you draw the triangle. Use a repeat loop in your triangle code. (Tip: you will need to turn
the turtle 120 degrees at each corner of the triangle.) You should see a house similar to the image
above.
3. Now draw a row of houses, with a gap between each house. You will need to wrap your code for a single
house in a repeat loop. Draw as many houses as you want, but at least three. You will need to lift the
pen up and reposition the cursor before the code repeats.
4. As a final touch, why not make your houses different colours? You can find the ‘Set colour to’ and
random colour blocks in the ‘Colour’ category.

In this accessible version, assume that the sides of the square and triangle in the house should be 50 units
long.

The commands necessary to write a program to complete the program are:

Move turtle forward by X distance The turtle moves according to the command. Choose an appropriate
number for X.

Turn turtle right/left by 30º, 90º, The turtle turns according to the command. (Choose right or left, and
120º, 150º, 180º a number of degrees)

Page 1 of 4
Pen up/ pen down The turtle raises/lowers its pen from the paper

Repeat X times (where X is a This block wraps any number of other blocks. All the blocks 'inside it’
number) are performed in order; the contents of this block are performed X
times.
Pick random colour Sets the pen to a random colour.

Please write your Row of Houses solution here:

Your Row of houses Solution Commands

Page 2 of 4
Row of houses solution

Command Comment/explanation
Loop A: Repeat 3 The contents of loop A draw a single house, and position the turtle ready to draw a
times new one.
Pen down

Pick random colour

Loop B: Repeat 4 Loop B draws the square that is the ‘base’ of the house.
times
Move forward by 50

Turn right by 90º

End Loop B

Move forward by 50 These next two lines reposition the turtle to draw the roof.

Page 3 of 4
Turn right by 30º

Loop C: Repeat 3 Loop C draws the triangle that is the roof of the house.
times
Move forward by 50

Turn right by 120º

End Loop C

Turn right by 150º The next four lines return the turtle to its starting position and direction.

Move forward by 50

Turn right (or left) by


180º
Pen up The pen is lifted to leave a gap between the row of houses

Turn right by 90º

Forward 60 This number could be any number greater than 50. Moving 60 leaves a gap between
the houses of 10.
Turn left by 90º

End Loop A

Page 4 of 4

You might also like