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 22, 2010
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
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
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
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
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
Friday, September 24, 2010
Week 3
Well this week is coming to a close. We learned about procedure commands where it makes typing in all those commands a LOT easier.
To Shape
Repeat 4 [Fd 100 Rt 90]
End
Then when you type shape in the command box it makes a square!
To Shape
Repeat 4 [Fd 100 Rt 90]
End
Then when you type shape in the command box it makes a square!
to awesome
Repeat 360 [squares rt 1]
Repeat 360 [squares rt 1]
to squares
Repeat 4 [fd 100 rt 90]
end
Repeat 4 [fd 100 rt 90]
end
These commands make this:
Teen pregnancy is a bad thing...
Friday, September 17, 2010
Week 2
This week we learned about Repeat Commands. They let us repeat a number of commands more than once. Like: repeat 4 [fd 100 rt 90] This command makes a 12 sided polygon ---> repeat 12 [fd 100 rt 30]
This command makes 1/4 of a circle ---> repeat 360 [fd 1 rt .25]
One challenge I came across though this week was on one of our assignments. We had to make a star with only one repeat command. I eventually got it and completed the assignment.
Well that's all for now. Until next time...
Suck it Alex Trebek!!!
This command makes 1/4 of a circle ---> repeat 360 [fd 1 rt .25]
One challenge I came across though this week was on one of our assignments. We had to make a star with only one repeat command. I eventually got it and completed the assignment.
Well that's all for now. Until next time...
Suck it Alex Trebek!!!
Friday, September 10, 2010
Week 1
Well this week was surprisingly fun. I didn't think this class was going to be so enjoyable. Well anyways, we learned about Logo. I'll leave a key on what happens when you type certain commands in the box. We also learned about binary codes on the computer. I mean holy crap that was confusing!
Binary- Let's take the number 345 for example. This is a three digit number. We know that the farthest right number, 5, represents the 1's column, and there are 5 ones. The next number from the right, the 4, represents the 10's column. There are 4 clicks in the 10s column, which we interpret as forty. Finally, the third column that contains the 3 represents the 100s column, and we know it to be three hundred.
Logo Key
fd= Makes the cursor go forward
bk= The cursor goes back
pu= Picks the cursor up so it can't write
pd= Puts the pen down
Binary- Let's take the number 345 for example. This is a three digit number. We know that the farthest right number, 5, represents the 1's column, and there are 5 ones. The next number from the right, the 4, represents the 10's column. There are 4 clicks in the 10s column, which we interpret as forty. Finally, the third column that contains the 3 represents the 100s column, and we know it to be three hundred.
Logo Key
fd= Makes the cursor go forward
bk= The cursor goes back
pu= Picks the cursor up so it can't write
pd= Puts the pen down
setpencolor= Sets a color to the cursor so you write in that color
Until next time, it's Merk Merkman!!!
Friday, September 3, 2010
Starting Off
Well we started our blogs today in Principals Of Computer Science. This year is gonna be hectic. Oh well I think I'll live. Until the next post, chicka chicka yeah, it's Merk Merkman!
Subscribe to:
Posts (Atom)