4.5. Practice Makes Perfect¶
Command |
What does it do? |
---|---|
|
Move forward a specified distance |
|
Move backward a specified distance |
|
Turns 90 degrees to the left (you can use any angle, not just 90!) |
|
Turns 90 degrees to the right |
|
Draws a circle with the specified radius |
|
Move straight to the position with coordinates (x, y). Note: the center is (0, 0) |
|
Stop leaving a trail |
|
Start drawing a trail |
|
Set the color to c (https://trinket.io/docs/colors) |
|
Repeat n times |
Command |
What does it do? |
---|---|
|
Starts filling in drawn shapes |
|
Stops filling in drawn shapes |
|
Determines how quickly the turtle will move through commands |
|
Creates and defines a new function |
|
Calls a function |
move forward 50 pixels
turn left 144 degrees
How might you draw a forest? Draw a bunch of pine trees!
How might you draw a pine tree? Draw a stack of triangles!
How might you draw a stack of triangles? Draw individual triangles offset in a loop!
triangle()
using a for looptree()
by calling triangle()
inside of a loopforest()
by calling tree()
inside of a loopforest()
function, and watch the magic happen!