Discuss Scratch

Vract0
Scratcher
100+ posts

Break Control Block

Note: This is a duplicate. Please continue the discussion here.



The break block would be used to exit out of a loop and is present in many text-based coding languages.

break


This could be used in the following example.


setNumber To End Onto6repeatpickrandom30to100setitopickrandom1to10ifi=NumberToEndOnthensetRandom NumbertojoinNumberToendOnibreakThe block I have proposed to be added.setRandom NumbertojoinNumberToendOni

In the example, the script adds a random number to the Random Number variable every iteration, but if it sees that the number about to be added is 6, then it breaks(exits) out of the repeat loop.

Last edited by Vract0 (Feb. 24, 2021 17:37:24)

E_Equals_EmCeCube3
Scratcher
1000+ posts

Break Control Block

It looks like this suggestion has been proposed before in this topic.
Feel free to continue the discussion there in order to keep individual suggestions organized and in one topic.
Vract0
Scratcher
100+ posts

Break Control Block

E_Equals_EmCeCube3 wrote:

It looks like this suggestion has been proposed before in this topic.
Feel free to continue the discussion there in order to keep individual suggestions organized and in one topic.
Ok, Thank you, I will be reporting this to be closed.

Powered by DjangoBB