This week we learned about setxy, setheading, and Logo variables. Typing in something like "setxy 100 100" will put the turtle in that position. The whole screen is like a graph, but with invisible lines, so it would put the turtle at (100,100). You can also go "setx 100" or "sety 100". Now setheading is kind of the same but instead of putting the turtle at a different position, it puts it in a different stance. Like typing in "setheading 180" will rotate the turtle until it gets to a 180 degree angle. Logo variables are commands you can use to change the size of what you're making.
For example, if you put for a command:
to house :size
repeat 5 [fd :size rt 90]
lt 60
end
to roof :size
repeat 3 [fd :size rt 120]
end
to wholehouse :size
house :size
roof :size
end
Type in "wholehouse 100" and you will get this house. Type in "wholehouse 50" and you will get a smaller house.
This concludes this week's post. Until next time, it's my birthday today! ;-D
No comments:
Post a Comment