Discuss Scratch

quadruple_door
Scratcher
100+ posts

Break out of Loop block

bump
quadruple_door
Scratcher
100+ posts

Break out of Loop block

this thread needs to stay alive
Zydrolic
Scratcher
1000+ posts

Break out of Loop block

__Falcon-Games__ wrote:

(#17)
TAKE THAT! If the condition is something that will be different when it reaches the final part of the code then it needs to break the loop there so the condition is the same.
this is not a good argument but I am trying to get this suggestion accepted now, whatever it may take
I have a proper argument.

Just create checksums for it.
WindowsMeRules2000
Scratcher
500+ posts

Break out of Loop block

quadruple_door wrote:

Stop(this loop v) ::control
this would be a scratch block that when used, does what it says, breaks out of a loop!

(example)
|
|
|
V

when green flag clicked
set [my variable v] to [0]
set [ random variable v] to (pick random (1) to (900))
repeat (900)
change [my variable v] by (1)
if < (my variable) = (random variable) > then
Stop(this loop v) ::control

end

end
do whatever now

(for context, if a loop is inside a loop it wont stop both loops, only the one its in.)
(this wont do anything outside a loop)
I am extremely confident this is a dupe but i’m too lazy to search
ajskateboarder
Scratcher
1000+ posts

Break out of Loop block

WindowsMeRules2000 wrote:

I am extremely confident this is a dupe but i’m too lazy to search
This is indeed a duplicate of this topic by the god-tier forumer, theonlygusti
AdityasWorldOffic
Scratcher
62 posts

Break out of Loop block

__Falcon-Games__ wrote:

CrazyCoder1247 wrote:

Scratchcat12562 wrote:

__Falcon-Games__ wrote:

Scratchcat12562 wrote:

stop [this script v]
This block exists already
why aren't kids more smarter?
They mean break out of the current loop, not break out of the current script/stop the script.
oh i understand now this would be pretty useful for stuff
first of all, __Falcon-Games__, be nice, second of all, look:
repeat until <>

end
amazing, right?
1. I am being nice, I was just wondering a question which I put in small tags which didn't have to be noticed by anyone which wasn't meant to cause any offense
2. What does that have to do with this suggestion?
For 2, the repeat until block basically repeats the things inside until the certain requirement is met. The the loop will stop. Very simple
Skyraiderr
Scratcher
36 posts

Break out of Loop block

sorry i did not all the way read it

Last edited by Skyraiderr (Sept. 9, 2023 15:33:39)

cosmosaura
Scratch Team
1000+ posts

Break out of Loop block

ajskateboarder wrote:

WindowsMeRules2000 wrote:

I am extremely confident this is a dupe but i’m too lazy to search
This is indeed a duplicate of this topic by the god-tier forumer, theonlygusti
Thanks for the link! It does look like this is a duplicate topic so I'll close it to keep the conversation all in one place. Please use the existing topic in the link above.

Powered by DjangoBB