Turtle Confusion Challenges¶
The following images will provide you a chance to think through the logic of how to draw a particular image. It is a great challenge to try to think through the solution completely first, then write the code. Challenge yourself to have your code work correctly the first time it runs!
Note
These images are included with the permission of Barry Newell. They are from Barry’s Turtle Confusion book (published in 1988).
1¶
Use at least one variable to make it easy to change the size of the square.
2¶
Use the for
loop structure when drawing this rectangle. Consider the ways the rectangle is the same as a square, and the ways it is different.
3¶
It might help if you regarded this shape as a rectangle with a chunk bitten out of the corner. See if you can draw the shape with the bite taken out of a different corner as well. Sometimes you can solve these puzzles in a nice, simple way; other times, you can’t. Looking for a pattern to write a simple solution can usually help you learn something, though!
4¶
Let’s draw the image three different ways:
using any commands that you like
using only the
.forward()
and.right()
commandsusing
.forward()
,.backward()
, and.right(90)
(note that you may use 90, and only 90, as the argument to the.right()
command for this solution)
5¶
6¶
Go back to the code you wrote for the first image and turn it into a function, so that you can call something like square(my_turtle, 100)
.
7¶
8¶
If you are struggling with the shapes we are drawing, don’t worry too much about making the solution to this problem elegant. However, if you are feeling confident, see if you can think through how you might be able to draw this shape in a different, simpler way.
9¶
Challenges 9 to 13 are all very similar…
10¶
11¶
12¶
13¶
14¶
Find the pattern, then repeat.
15¶
Think about the total angle that the turtle must turn to create this shape.
16¶
Have you drawn a portion of this shape before?
17¶
Have you drawn a portion of this shape before?
19¶
Have you drawn a portion of this shape before?
20¶
Have you drawn a portion of this shape before?
21¶
Have you drawn a portion of this shape before?
22¶
Have you drawn a portion of this shape before?
23¶
Have you drawn a portion of this shape before?
24¶
No more hints from this point on. You can figure it out!