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

#1 2010-04-05 16:12:40

DarthPickley
Scratcher
Registered: 2008-06-13
Posts: 100+

occurrences/position of item in list block

I know that there is already a block for "<list contains item>" but it is only somewhat useful in projects (okay, it can help optimize lots of routines by saving search time) but there are a few blocks that would be even more useful.
First of all, you could replace the <list contains item> Boolean with an (occurrences of item in list) reporter, which could serve the same purpose but be even more useful. <list contains item> is the same as < (occurrences of item in list) > (0) >.
Alternately, a (position of item in list) block is even more useful and would also serve the same purpose of the <list contains item> in that if the list contains the item, it will return a positive value, and otherwise returns 0. This block would be very useful, since it has many applications.

Last edited by DarthPickley (2010-04-05 16:13:01)

Offline

 

#2 2010-04-05 19:56:31

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: occurrences/position of item in list block

I also want an (item containing ____ ) to reduce the need for huge searches...

Offline

 

#3 2010-04-08 10:42:04

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: occurrences/position of item in list block

Good ideas! AWESOME IDEAS! Needs a *bump*


http://block.site90.net/scratch.mit/text.php?size=30&amp;text=%20A%20signature!&amp;color=333333

Offline

 

Board footer