Discuss Scratch

destroyer489
Scratcher
28 posts

Add a For loop

so I use Python, C++, and Java a lot and have the great functionality of the for-loop. this is a loop that repeats a certain number of times while having an index this is especially useful for lists and tuples. more documentation can be found here. this type of loop is incredibly useful and would be a fantastic addition to the scratch library
-Accio-
Scratcher
1000+ posts

Add a For loop

This has been suggested so many times that I can't even find an oldest duplicate.

Hi There! I'm -Accio-

But you can call me the Duplicate Destroyer

Potterhead | Ravenclaw | Forum Helper | SDS Curator | Science | Math


Check out the current SDS “Puzzled” here:
https://scratch.mit.edu/studios/20766887/
colinmacc
Scratcher
500+ posts

Add a For loop

set [index v] to [0]
repeat (10)
change [index v] by (1)
Do things...
end

- Sample Projects -


ResExsention
New to Scratch
1000+ posts

Add a For loop

colinmacc wrote:

set [index v] to [0]
repeat (10)
change [index v] by (1)
Do things...
end

Uh, close, but not quite.

set [index v] to [0]
set [target v] to [whatever, even another variable]
repeat (target)
change [index v] by (1)
...
end

Semi-support though. For loops are actually quite useful.

Last edited by ResExsention (May 22, 2019 01:57:50)


Hi, I'm ResExsention, a New Scratcher who refuses to press that button! I hope we get to know each other and become friends!

If you see "[DATA EXPUNGED]", you'll know it was deleted by me. It's a lot easier.

Powered by DjangoBB

Standard | Mobile