Repeat Until/Do While code

alternatives
control_flow

#1

Although we don't have a Repeat Until/Do While block, people have found ways of doing this manually :smiley:

This way involves putting code in an ability and it will keep on calling itself while a condition is true:


(This will repeat setting its color to purple while ValueB = 1. Alternatively you can change the condition to a Not Equals for Repeat Until conditions.)

You could also use a Repeat Forever which continually checks if something meets a condition and stops when it doesn't. Credits to AwesomeCilantro for this!


However, you won't be able to add more code to this rule though, or it won't run.

A while ago, I made a project including these two examples too:


More formal ideas relating to control flow
#2

I knew I couldn't be the first to come up with the first method. Hehe.


#3

Ooh yeah, I've used this method before to make my force-close project last year:

Thanks for making this topic - it's a really great technique to know of for sure. :D


#4

Oooh yes it did use to crash the app! I have been able to use it recently, I think they had fixed that up


#5

What's interesting to me about this project is that when you run it multiple times, each time it will be more and more prone to crashing. It's as if the CPU decides to dedicate more RAM to the app because it noticed an overload in a previous session of the app... intriguing. :o