Learn with tiles › 30
Making a list
Gather several values in one row and take them out by position number.
1
A list is a box that holds several values in order. One variable holds values in a row.
The tile at the top makes the list fruits. It holds apple, pear and plum in that order.
The list[(0)] tile takes one value out of a list. As with text, positions are counted from 0. fruits[0] is apple.
To do Make the third value of the list, plum, appear.
Loading tiles…
2
The List: add (value) tile puts one more value at the very end of a list. List: count tells you how many values there are.
If you write a whole list, its values appear joined with spaces.
Add kiwi, then write the count and the list. The value slot holds the number 0 at first. To put text in, tap the slot and choose "Text" under Values in ▾.
To do Add kiwi to the list fruits so that the count 4 and apple pear plum kiwi appear.
Loading tiles…
3
The set list[(0)] to (0) tile changes the value at that position to another value.
Change the second value.
To do Change the second value pear to grape so that apple grape plum appears.
Loading tiles…