GoCode Control Flow - Owen2k6/GoOS GitHub Wiki

Control Flow & Indentation

Tabs define blocks

The interpreter computes:

  • currentLevel = number of leading tabs on the current line
  • expectedLevel = the next allowed level after a successful if=
  • 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.

Example

int score = 15
if=score>10
	println="Great!"
println="Done"

Output:

Great!
Done

If score were 5, only Done prints.

goto=<lineNumber>

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.)

sleep=<milliseconds>

Pause execution using Thread.Sleep(ms):

sleep=500

stop= / stop=Prompt

Waits for a key. With a value, writes the prompt in dark red first.

stop=Press any key to continue...
⚠️ **GitHub.com Fallback** ⚠️