If you get 3 points...
In addition to the variables, Scratch lets you use another data type to store project information: The lists. The lists can store more than one value at the same time, so they are ideal for storing rewards have been recovered by a character or set of names, raise a couple of examples.
To create a list, you have to go to the data category, click on 'Create a List' and give a name. In the example, we have named our 'Students' list:
when green flag clicked
delete (all v) of [Students v]
repeat (3)
ask [Introduce a student name] and wait
insert (answer) at (last v) of [Students v]
What have we done with this program? The first thing we do is, to start execution, delete all items from the list Students, to empty it completely and not appear elements of an previous project implementation. Then we ask three times the user to enter a name, and each name entered insert it in the last position in the list Students.
What we do with the list? We could, for example, use it to get a volunteer to carry out an exercise to the whiteboard. Look at the new instructions added to the program:
when green flag clicked
delete (all v) of [Students v]
repeat (3)
ask [Introduce a student name] and wait
insert (answer) at (last v) of [Students v]
end
say [Today's volunteer will be...] for (2) secs
say (item(pick random (1) to (3)) of [Students v]) for (2) secs
We generated a random number between 1 and 3, which are the elements in the list, we selected the element that occupies that position in the list. Sometimes we take the name that is in position 1, others that it is in position 2 and the other at 3.
Lists have many possibilities and many available operations ... you dare to investigate how they work?