Implemented break and continue and improved label stack handling

This commit is contained in:
cannoli-fruit 2026-07-31 06:42:17 -04:00
commit 1606150450
3 changed files with 97 additions and 14 deletions

11
flagpole/tests/break.fp Normal file
View file

@ -0,0 +1,11 @@
$inc fvmstd.fp
proc main
while 1 do
if :getuint 37 == then
break
endif
"Try again" :puts :newline
endwhile
"You got it!" :puts :newline
endproc

View file

@ -0,0 +1,20 @@
$inc fvmstd.fp
proc main
while 1 do
if :getuint 37 == not then
"Number 1 incorrect" :puts :newline
continue
endif
if :getuint 42 == not then
"Number 2 incorrect" :puts :newline
continue
endif
if :getuint 69 == not then
"Number 3 incorrect" :puts :newline
continue
endif
break
endwhile
"You've logged in" :puts :newline
endproc