Skip to content

Instantly share code, notes, and snippets.

@raspberrypisig
Created September 18, 2020 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raspberrypisig/c0c340cb418ec3270f338933c558db8b to your computer and use it in GitHub Desktop.
Save raspberrypisig/c0c340cb418ec3270f338933c558db8b to your computer and use it in GitHub Desktop.
'type suffix (default integer, ! for float, % for number, $ for string)
STATE=1
SUB SETUP
PRINT "Running setup..."
END SUB
SUB MAIN
IF STATE = 1 THEN
PRINT "Doing nothing..."
ELSE IF STATE = 2 THEN
TASK1
ELSE
TASK2
END IF
PRINT "Current State:", STATE
END SUB
SUB TASK1
PRINT "task 1"
END SUB
SUB TASK2
PRINT "task 2. Now return to state 1"
STATE=1
END SUB
SETUP
DO
INPUT "Type a number [1-3]:"; STATE
MAIN
LOOP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment