Discuss Scratch

dd-i
New Scratcher
1 post

Lists

Hello, I've created 2 lists, one of randomly generated numbers and one of the inputted names. I need one sprite to ask “whos grade do you want to know?” and the other sprite to respond with a name and the original sprite to say the grade. I've attached the link so you'll know what I'm trying to do.
Please help!!!!!

https://scratch.mit.edu/projects/301684390/
mstone326
Scratcher
1000+ posts

Lists

You'll need to create a variable, maybe called index or item, to be able to get each item of the list.

Then use the item 1 of list but snap the index reporter into it. This script below would pull the 2nd item from each list.

set [index v] to [2]
(item (index) of [names v] :: list)
(item(index) of [grades v] :: list)

Last edited by mstone326 (April 19, 2019 15:42:38)

powercon5
Scratcher
1000+ posts

Lists

So you want it to return the item that's in the same position in the grades list as the inputted name is in the name list? Assuming no duplicate names you could do

(item (item # of (thing v ) of [names v] :: list)  of [grades v] :: list)

Powered by DjangoBB