Do loop until failure or condition else

From Esolang
Jump to navigation Jump to search

Do loop until failure or condition else is an esoteric language construct and form of loop that is REALLY complicated. In the loop, there are two bodies (the main body and the else body) and two conditions (a cap condition and the main body itself.)


Consider the D-LUF|C-E (that's a really complicated acronym) loop here:

do {
    x = doSomething();
} until failure or x>5 else {

This is a really complicated loop. What it means, essentially, is to run a do..while loop where the condition is the success of the body OR a secondary condition. If the secondary condition activates before the main condition, then the else loop is activated (alternatively, it could be the failure condition triggering the else loop. Not sure which to make it.)

See Also

Do loop until failure