LOGO Challenge 4 - Squares to Procedures
This LOGO Challenge emphasises the idea of breaking down a problem
into smaller manageable parts. Working on squares and angles.
Problem
Let's look again at the designs you may have created in an earlier
Challenge using the REPEAT command ..
How about trying to create these, or similar designs, using procedures.
How about trying to create these, or similar designs, using procedures.
- Create a procedure for a square.
- Now create procedures that put the squares together in different ways.
Notice how useful it is to be able to just write "square" when
you want LOGO to draw a square.
Image
Image
Teachers' Resources
You can create several procedures for different objects and combine
them:
Here is a procedure for a square (called "sq"):
And, here is a procedure for an equilateral triangle:
Here is a procedure for a "house"!
See if you can produce some patterns based on "sq" and "tri" using procedures.
The biggest challenge is to be able to tell the turtle how to get to the right place pointing in the right direction to join shapes together in the way you intended.
Can you write a procedure to produce a row of houses?
Here is a procedure for a square (called "sq"):
To sq
REPEAT 4 [FD 40 RT 90]
end
And, here is a procedure for an equilateral triangle:
To tri
REPEAT 3 [FD 40 RT 120]
end
Here is a procedure for a "house"!
To house
sq FD 40 RT 30 tri
end
See if you can produce some patterns based on "sq" and "tri" using procedures.
The biggest challenge is to be able to tell the turtle how to get to the right place pointing in the right direction to join shapes together in the way you intended.
Can you write a procedure to produce a row of houses?