Here's how to make a for loop in scratch:
You need your list and two variables. Variable a and variable b. And your list, c.
Here's the code:
set [a v] to [0] repeat until < (a)>(length of c) > change [a v] by [1] set [b v] to (item(a) of c) endAfter that last line inside the "repeat until" yo can do whatever you want with variable b, which is item (a) of list c. You can use this to delete all the zeros in a list for example by adding this code:
if < (b)=[0] > delete (a) of c
Offline
Here's how to make a for loop in scratch:
You need your list and two variables. Variable a and variable b. And your list, c.
Here's the code:
set [a v] to [0] repeat until < (a)>length of c > change [a v] by [1] set [b v] to item(a) of c endAfter that last line inside the "repeat until" yo can do whatever you want with variable b, which is item (a) of list c. You can use this to delete all the zeros in a list for example by adding this code:
if < (b)=[0] > delete (a) of c
Offline