GoCode Control Flow - Owen2k6/GoOS GitHub Wiki
The interpreter computes:
-
currentLevel
= number of leading tabs on the current line -
expectedLevel
= the next allowed level after a successfulif=
-
skipLevel
=expectedLevel + 1
When an if=
is true, it sets expectedLevel = currentLevel + 1
so that one extra tab level will execute. Lines that are deeper than skipLevel
are skipped.
int score = 15
if=score>10
println="Great!"
println="Done"
Output:
Great!
Done
If score
were 5, only Done
prints.
Jump to a 1‑based line number in the loaded script:
goto=12
(Internally sets the instruction index to lineNumber - 2
so the next loop iteration lands on the target.)
Pause execution using Thread.Sleep(ms)
:
sleep=500
Waits for a key. With a value, writes the prompt in dark red first.
stop=Press any key to continue...