Would anyone mind offering a more eligant programming solution to my "Ask the Panda" than the 39 "if" blocks I used at:
http://scratch.mit.edu/projects/rico/394988
I am having a great time introducing Scratch to elementary school students (ages 8-11), but I do not know much about programming. It doesn't take the students to surpass my ability to provide assistance. I would like to learn more about programming, and I would appreciate any tips on this question to get me going in the right direction.
Offline
How about this:
Just add the rest of your quotes to the list.
It starts by clearing out the list, then adds each quote to it. Picks a random number based on how many quotes are in the list, then says whatever quote is in that position within the list. If that makes sense, then you're well on your way to more advanced stuff. Keep at it!
Last edited by mrweston (2009-01-29 02:33:33)
Offline
mrweston wrote:
How about this:
http://sixtyten.ca/misc/panda.jpg
Just add the rest of your quotes to the list.
It starts by clearing out the list, then adds each quote to it. Picks a random number based on how many quotes are in the list, then says whatever quote is in that position within the list. If that makes sense, then you're well on your way to more advanced stuff. Keep at it!![]()
Rather than delete the items in the list individually, you can delete them all at once with the "Delete All of Things to Say" block.
Offline
mrweston wrote:
Hmm! Is that what that does? Picks a random item? Hadn't thought of that -- nice one.
Yes, that's what it does.
Offline