Friday, October 22, 2010

Week 6

This week, we learned about infinite loops. A good example of an infinite loop would be like the life of a butterfly. A caterpillar is born, grows and eats food, then when it turns in to a butterfly, it lays eggs and dies and the whole process starts over again.

This code shows random numbers from 1 to 100, looped over and over again:

to numbers
print random 100
numbers
end

Well that's all for this week. This is Marky Mark saying:
"Don't taze me bro!"

Friday, October 15, 2010

Week 5

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

Tuesday, October 5, 2010

Week 4

This week we learned about random commands. It sends the turtle (cursor) on a random walk. Like in Pac-Man or Banjo- Kazooie, the enemies will go on a random walk, until they see the character you're playing and chase after you.
To generate random numbers, you just type in print, then random and any number you want. It will process the command and show it between 0 and the number you typed.
To generate numbers between 4 and 13, you would type in print random 13.
Well that's all for this week. Until next time, this is Merk Merkman saying:
"Kyle Beckedorf...Kyle Beckedorf, please report to the principals'soffice. :-D