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:
After 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:seta ▼to0repeat untilalength of c>changea ▼by1setb ▼toitem(a) of c
ifb=0deleteaof 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:
After 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:seta ▼to0repeat untillength of c >achangea ▼by1setb ▼to itemaof c
ifb=0deleteaof c
Offline