Last active
October 13, 2018 19:13
-
-
Save ThomasTheSpaceFox/4a5d1d92d077c7cc3b3a111cc57c3c2a to your computer and use it in GitHub Desktop.
SSTNPL program that presents the user with the option to change a boolean value.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# #### VARS #### | |
var kb=0 | |
var retflg=0 | |
var value=0 | |
# #### MAIN #### | |
label main | |
print boolean value: | |
dumpd value | |
newline | |
prline 'n' to change boolean value, or 'q' to quit | |
keyprompt | |
set kb | |
if kb,:q gsub quit | |
if kb,:Q gsub quit | |
if kb,:n gsub number | |
if kb,:N gsub number | |
goto main | |
# #### NUMBER #### | |
label number | |
val 0 | |
set retflg | |
prline press 0 or 1 | |
label number_loop | |
keyprompt | |
set kb | |
if kb,:0 =retflg @1 | |
if kb,:0 =value @0 | |
if kb,:1 =retflg @1 | |
if kb,:1 =value @1 | |
if retflg,@1 return | |
goto number_loop | |
# #### QUIT #### | |
label quit | |
stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment