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

#1 2009-05-24 01:33:36

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

"item [any] of list"?

I noticed there's an option in the (item __ of list) block called "any". I could never figure out what that means. Does it mean it checks if any item is named that, or does it pick an item from the list at random? (the latter being completely useless, since you can easily use "pick random (1) to ((length of list))".)

I'm just wondering, because I haven't really used lists that much.


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#2 2009-05-24 01:48:33

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: "item [any] of list"?

It picks a random value


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2009-05-24 08:14:22

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

Re: "item [any] of list"?

Yeah, I've seen people get confused by this one...they use it in a comparison and expect it to find a matching value...when all it really does is return a random value.  Pretty useless, now that I think on it.


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

Offline

 

#4 2009-05-24 10:18:00

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: "item [any] of list"?

Never really used that - whoah, is that ever useless.

Offline

 

#5 2009-05-24 11:58:44

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: "item [any] of list"?

no wonder my Xs and Os project bugs sometimes, i thought it checked all the values!

Offline

 

#6 2009-05-24 12:11:47

Mozaz
Scratcher
Registered: 2009-05-19
Posts: 500+

Re: "item [any] of list"?

Maybe it's a glitch, because it seems stupid to have an option like that, when you could just use the random block.

This block would be great if it did what it said on the cover.


http://i33.tinypic.com/15i5fmp.png

Offline

 

#7 2009-05-24 12:22:00

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: "item [any] of list"?

Mozaz wrote:

Maybe it's a glitch, because it seems stupid to have an option like that, when you could just use the random block.

This block would be great if it did what it said on the cover.

It does do what it says it does. It picks any item.

Offline

 

#8 2009-05-24 13:04:33

DawnLight
Scratcher
Registered: 2009-04-25
Posts: 500+

Re: "item [any] of list"?

coolstuff wrote:

Mozaz wrote:

Maybe it's a glitch, because it seems stupid to have an option like that, when you could just use the random block.

This block would be great if it did what it said on the cover.

It does do what it says it does. It picks any item.

SO that block picks a random from the list and does something to it?

Offline

 

#9 2009-05-24 13:10:23

Mozaz
Scratcher
Registered: 2009-05-19
Posts: 500+

Re: "item [any] of list"?

coolstuff wrote:

Mozaz wrote:

Maybe it's a glitch, because it seems stupid to have an option like that, when you could just use the random block.

This block would be great if it did what it said on the cover.

It does do what it says it does. It picks any item.

I would think it it meant that it checks every item in the list, and if one of them equals a value then it does whatever.


http://i33.tinypic.com/15i5fmp.png

Offline

 

#10 2009-05-24 13:14:41

DawnLight
Scratcher
Registered: 2009-04-25
Posts: 500+

Re: "item [any] of list"?

Mozaz wrote:

coolstuff wrote:

Mozaz wrote:

Maybe it's a glitch, because it seems stupid to have an option like that, when you could just use the random block.

This block would be great if it did what it said on the cover.

It does do what it says it does. It picks any item.

I would think it it meant that it checks every item in the list, and if one of them equals a value then it does whatever.

But isn't it random?

Offline

 

#11 2009-05-24 13:50:58

Mozaz
Scratcher
Registered: 2009-05-19
Posts: 500+

Re: "item [any] of list"?

It is, but I'm saying it would be better if it wasn't random, and if it did check every item on the list for a certain value.


http://i33.tinypic.com/15i5fmp.png

Offline

 

#12 2009-05-24 16:17:57

BoltBait
Scratcher
Registered: 2009-03-09
Posts: 1000+

Re: "item [any] of list"?

Here is one possible use for it:

You could have a list of wise cracks and every turn your computerized opponent chooses one to taunt you with.


Animated sigs must be banned!
http://boltbait.com/j.pnghttp://boltbait.com/s.pnghttp://boltbait.com/d.pnghttp://boltbait.com/a.pnghttp://boltbait.com/p.png

Offline

 

Board footer