This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-01-28 22:22:50

rico
Scratcher
Registered: 2007-05-22
Posts: 47

Programming Tips

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

 

#2 2009-01-29 02:30:56

mrweston
Scratcher
Registered: 2007-12-13
Posts: 100+

Re: Programming Tips

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!  smile

Last edited by mrweston (2009-01-29 02:33:33)

Offline

 

#3 2009-01-29 05:01:21

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Programming Tips

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!  smile

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.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#4 2009-01-29 11:34:49

mrweston
Scratcher
Registered: 2007-12-13
Posts: 100+

Re: Programming Tips

Oh, er, yes. Was working on another project where I needed to do it one at a time; must've been stuck in the head.  smile

Offline

 

#5 2009-01-29 19:05:08

floppy_gunk
Scratcher
Registered: 2008-11-14
Posts: 500+

Re: Programming Tips

I prefer this: http://i43.tinypic.com/s1ov8y.gif


http://img163.imageshack.us/img163/1917/2856lg.jpg Get it now!  smile

Offline

 

#6 2009-01-29 19:26:28

mrweston
Scratcher
Registered: 2007-12-13
Posts: 100+

Re: Programming Tips

Hmm! Is that what that does? Picks a random item? Hadn't thought of that -- nice one.

Offline

 

#7 2009-01-29 20:28:26

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Programming Tips

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.


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#8 2009-01-29 22:23:28

rico
Scratcher
Registered: 2007-05-22
Posts: 47

Re: Programming Tips

Three Cheers for the Scratch Community!!! Thank you all for the great suggestions. I am learning all the time. I tried to create a list but had no idea how to make it work. Thanks again, everyone.

Offline

 

#9 2009-01-29 23:40:41

mrweston
Scratcher
Registered: 2007-12-13
Posts: 100+

Re: Programming Tips

We're all learning all the time -- it's fun, isn't it?  smile

Here's a cleaned up version, just to be tidy:

http://sixtyten.ca/misc/panda2.jpg

Last edited by mrweston (2009-01-29 23:40:51)

Offline

 

#10 2009-01-31 06:35:10

rico
Scratcher
Registered: 2007-05-22
Posts: 47

Re: Programming Tips

Thanks again!

Offline

 

Board footer