Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » Is repeat until Scratch's version of the For loop?
- HeHeTeeHeeHee
- Scratcher
100+ posts
Is repeat until Scratch's version of the For loop?
If it isn't then what is it?
repeat until <yes>
end
i'm brain dead aren't ii usually use advanced topics or help with scripts but sometimes i can be found in things i'm playing and reading
- RL1123
- Scratcher
1000+ posts
Is repeat until Scratch's version of the For loop?
The repeat until loop is not while loop:
repeat until <not <>> // the same as a while loop
end
through tough thorough thought, though
Signature #11
- lolecksdeehaha
- Scratcher
1000+ posts
Is repeat until Scratch's version of the For loop?
That… wasn't the question? The repeat until loop is not while loop:repeat until <not <>> // the same as a while loop
end
I guess, if you use it like this:
set [result v] to (0)
set [i v] to (0)
repeat until <(i) > (9)>
change [result v] by (i)
end
Beep boop. I am a robot, and this action was performed automatically. If you have any concerns, please contact the owner of this robot.
ing season coming “soon”
I'm the founder of Forumoji, the source of all those neat forum emojis you occasionally see (the ones not in the default menu).
ing season coming “soon”
I'm the founder of Forumoji, the source of all those neat forum emojis you occasionally see (the ones not in the default menu).
- HeHeTeeHeeHee
- Scratcher
100+ posts
Is repeat until Scratch's version of the For loop?
That… wasn't the question? The repeat until loop is not while loop:repeat until <not <>> // the same as a while loop
end
I guess, if you use it like this:set [result v] to (0)
set [i v] to (0)
repeat until <(i) > (9)>
change [result v] by (i)
end
Lets be honest, who does it like that though.
i'm brain dead aren't ii usually use advanced topics or help with scripts but sometimes i can be found in things i'm playing and reading
- lolecksdeehaha
- Scratcher
1000+ posts
Is repeat until Scratch's version of the For loop?
That was just an example. And a lot of people do it like that. If you don't use it like this, then it's not a for loop.Lets be honest, who does it like that though.~snip~~snip~
Last edited by lolecksdeehaha (Feb. 7, 2022 18:18:14)
Beep boop. I am a robot, and this action was performed automatically. If you have any concerns, please contact the owner of this robot.
ing season coming “soon”
I'm the founder of Forumoji, the source of all those neat forum emojis you occasionally see (the ones not in the default menu).
ing season coming “soon”
I'm the founder of Forumoji, the source of all those neat forum emojis you occasionally see (the ones not in the default menu).
- 10goto10
- Scratcher
500+ posts
Is repeat until Scratch's version of the For loop?
I think that’s the main difference. Nothing automatically increments the variable i as a counter So …
I guess, if you use it like this:set [result v] to (0)
set [i v] to (0)
repeat until <(i) > (9)>
change [result v] by (i)
end
change [i v] by (1)needs to be in the repeat until loop.
And I’ll admit that I use it this way in my projects all the time because I don’t usually want to try and find the hidden “for each” block.
Are you asking who, when they are designing a programming language, would not include something like: Lets be honest, who does it like that though.
for(var i = 0; i < 10; i++) {
}
Do you have an Animate a Name project that you'd like to have added to a studio? Please leave a comment in this studio.
- lolecksdeehaha
- Scratcher
1000+ posts
Is repeat until Scratch's version of the For loop?
You quoted OP incorrectly (I fixed it here)I think that’s the main difference. Nothing automatically increments the variable i as a counter So …
I guess, if you use it like this:set [result v] to (0)
set [i v] to (0)
repeat until <(i) > (9)>
change [result v] by (i)
endchange [i v] by (1)needs to be in the repeat until loop.
And I’ll admit that I use it this way in my projects all the time because I don’t usually want to try and find the hidden “for each” block.Are you asking who, when they are designing a programming language, would not include something like: Lets be honest, who does it like that though.for(var i = 0; i < 10; i++) {
}
Yeah, I forgot the main point of an I loop; here's the fixed one:
set [result v] to (0)
set [i v] to (0)
repeat until <(i) > (9)>
change [i v] by (1)
change [result v] by (i)
end
Beep boop. I am a robot, and this action was performed automatically. If you have any concerns, please contact the owner of this robot.
ing season coming “soon”
I'm the founder of Forumoji, the source of all those neat forum emojis you occasionally see (the ones not in the default menu).
ing season coming “soon”
I'm the founder of Forumoji, the source of all those neat forum emojis you occasionally see (the ones not in the default menu).
- Discussion Forums
- » Questions about Scratch
- » Is repeat until Scratch's version of the For loop?