New games every week!
JSE - Putting on the Brakes Blog
23rd July 2021
After a couple of suggestions over at SoCoder, I added Continue and Break/Exit, yesterday.

-=-=-

The Continue command will stop the flow of the current for-loop, jump to the next "Next" command, then carry on looping.
The Exit (or Break) command will do the same, but will exit the current loop instead.
You can additionally add a parameter to Exit, to exit from the number of given loops.

Though this does indeed work, please be aware that it might get really weird if you start adding crazy for/repeat loops inside each other, especially if you throw if/then's into the places where the next/until's are happening.
But I'm sure you're getting used to the language having those sorts of quirks, by now.

// Breaks and Escapes // by Jayenkai // Created 2021/7/22 Graphics 512,512,1 SetFontSize 12 repeat cls Method=Floor((Mills()%3000)/1000)+1 For y=-1 to 11 For x=-1 to 11 InkRot (x*y*8)+Mills()*0.5,1,1 if x==y and Method==1 then Exit // Jumps to next next, breaking out of the next endif if x==3 and y==3 and Method==2 Exit(2) // Jumps two nexts, closing up loops as it goes endif if x==y and Method==3 then Continue // Jumps to next next, then continues end if if x>-1 and y>-1 and x<10 and y<10 text (x+2)*32,(y+2)*32,x,1:text ((x+2)*32)+12,((y+2)*32)+12,y,1 end if Next Next if Method==1 then Text 256,480,"Exit/Break when x==y",1 if Method==2 then Text 256,480,"Exit(2)/Break(2) when x==3 and y==3",1 if Method==3 then Text 256,480,"Continue when x==y",1 flip forever

Views 133, Upvotes 21  
Jse , Commands
New games every week!
Site credits : All of the above : Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed 89

Blog - JSE - Putting on the Brakes - AGameAWeek