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

#1 2010-07-02 09:53:31

markyiscool
Scratcher
Registered: 2008-04-09
Posts: 100+

A Question about Lists

Sorry about the vague title, but I have no other way to explain this.
Say if I had a list that contained the items 7, @ and c and i wanted to see if any one of these items are equal in another list, say the alphabet. In this example the 7 and the @ would not be equal to any item in the alphabet list but the c will. How would I go about doing this the easiest way and the least time consumption if i wanted something to repeat until it notices that one of the items (7, @, c)=an item on the list of the alphabet


Wanted the Netherlands to win or want to re-experience Spain's victory? Do it withthis!
Projects not being loved, here's an idea!

Offline

 

#2 2010-07-02 10:07:51

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

Re: A Question about Lists

So from what I understand, you want to see if one item from a list is in the other list?

Offline

 

#3 2010-07-02 10:10:44

markyiscool
Scratcher
Registered: 2008-04-09
Posts: 100+

Re: A Question about Lists

coolstuff wrote:

So from what I understand, you want to see if one item from a list is in the other list?

To put it basically, yes


Wanted the Netherlands to win or want to re-experience Spain's victory? Do it withthis!
Projects not being loved, here's an idea!

Offline

 

#4 2010-07-02 10:17:17

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

Re: A Question about Lists

markyiscool wrote:

coolstuff wrote:

So from what I understand, you want to see if one item from a list is in the other list?

To put it basically, yes

Well, you'd essentially have to loop through the items of the list. Here:

http://i45.tinypic.com/dwqlg5.gif

Last edited by coolstuff (2010-07-02 10:24:19)

Offline

 

#5 2010-07-02 10:20:07

markyiscool
Scratcher
Registered: 2008-04-09
Posts: 100+

Re: A Question about Lists

Thanks coolstuff for your quick and well set out response


Wanted the Netherlands to win or want to re-experience Spain's victory? Do it withthis!
Projects not being loved, here's an idea!

Offline

 

#6 2010-07-02 10:21:44

Jimmy-Jermaine
New Scratcher
Registered: 2010-06-25
Posts: 100+

Re: A Question about Lists

Also where it says 'Nope, those lists are completely different!', they might not be different, just that one thing is different between them. (Sorry, I have no technical input to add)

Offline

 

#7 2010-07-02 10:23:58

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

Re: A Question about Lists

Jimmy-Jermaine wrote:

Also where it says 'Nope, those lists are completely different!', they might not be different, just that one thing is different between them. (Sorry, I have no technical input to add)

Well, that was just my wording  smile  I'll edit my post.

EDIT: Actually, it means that there are no items the same between them  wink

Last edited by coolstuff (2010-07-02 10:25:01)

Offline

 

#8 2010-07-02 10:32:51

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: A Question about Lists

made this into a project

get it here

this makes a 3rd list of found items

Last edited by Locomule (2010-07-02 10:34:02)


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#9 2010-07-02 10:35:19

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

Re: A Question about Lists

Locomule wrote:

made this into a project

get it here

this makes a 3rd list of found items

yikes  That's genius! Excellent job!

Offline

 

#10 2010-07-02 11:21:17

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: A Question about Lists

Lol, yeah right up till I added my post and saw your earlier post hahah! Wait, we did the same thing bascially so you just complemented yourself! Thanks though  big_smile  See you kicking butt in here every day bro, mega kudos!! I joined the Scratch educators site but then I just came over here and started doing it instead.

Anyway I'm on dial-up so I'm stuck in this weird time-shifted alternate universe where I hit "submit" and 15 new posts magically appear in front of mine. I preserve my sanity by considering it a zen building experience??


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#11 2010-07-03 02:32:44

markyiscool
Scratcher
Registered: 2008-04-09
Posts: 100+

Re: A Question about Lists

Thanks to everyone who helped. I used the script in my project Shoot-Outs. What part of the game do you think I used it in?


Wanted the Netherlands to win or want to re-experience Spain's victory? Do it withthis!
Projects not being loved, here's an idea!

Offline

 

#12 2010-07-03 12:29:25

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

Re: A Question about Lists

markyiscool wrote:

Thanks to everyone who helped. I used the script in my project Shoot-Outs. What part of the game do you think I used it in?

Methinks when it computes your name, as per the project notes  smile

Offline

 

#13 2010-07-03 19:17:56

markyiscool
Scratcher
Registered: 2008-04-09
Posts: 100+

Re: A Question about Lists

coolstuff wrote:

markyiscool wrote:

Thanks to everyone who helped. I used the script in my project Shoot-Outs. What part of the game do you think I used it in?

Methinks when it computes your name, as per the project notes  smile

Wow, you must be some mind-reader! I'm really thankful for your help


Wanted the Netherlands to win or want to re-experience Spain's victory? Do it withthis!
Projects not being loved, here's an idea!

Offline

 

#14 2010-07-04 09:09:14

Jimmy-Jermaine
New Scratcher
Registered: 2010-06-25
Posts: 100+

Re: A Question about Lists

coolstuff wrote:

Jimmy-Jermaine wrote:

Also where it says 'Nope, those lists are completely different!', they might not be different, just that one thing is different between them. (Sorry, I have no technical input to add)

Well, that was just my wording  smile  I'll edit my post.

EDIT: Actually, it means that there are no items the same between them  wink

I see..

Offline

 

#15 2010-07-04 11:02:44

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: A Question about Lists

coolstuff wrote:

http://i45.tinypic.com/dwqlg5.gif

Surely it will only report back the last item on the list with that script?  hmm  I'll post what I think would work better in a while...  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#16 2010-07-04 14:52:03

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

Re: A Question about Lists

Wolfie1996 wrote:

Surely it will only report back the last item on the list with that script?  hmm  I'll post what I think would work better in a while...  smile

How so? It cycles through every list item and I've tested it and it works just fine...

Offline

 

#17 2010-07-04 14:55:10

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: A Question about Lists

coolstuff wrote:

Wolfie1996 wrote:

Surely it will only report back the last item on the list with that script?  hmm  I'll post what I think would work better in a while...  smile

How so? It cycles through every list item and I've tested it and it works just fine...

I think I misread it earlier  hmm  I thought it was an if-else block, instead of an if block... whoops >.<


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

Board footer