Code: Select all
Declare Sub room1
Declare Sub room2
Declare Sub startmenu
Dim Shared As String room
Dim Shared As BOOLEAN running
running = TRUE
room = "startmenu"
Sub startmenu()
Dim choice As String
cls
Print "welcome to this thing"
Print
Print "start or quit?"
Input "> ", choice
If choice = "start" Then room = "room1"
If choice = "quit" Then End
If choice <> "start" And choice <> "quit" Then
Print
Print "What?"
Print
Sleep
cls
EndIf
End Sub
Sub room1()
Dim choice As String
Print "You're in a room. There's another room. Wanna check it out (y/n)?"
Input "> ", choice
If choice = "y" Then room = "room2"
If choice = "n" Then room = "room1"
If choice <> "y" And choice <> "n" Then
Print
Print "What?"
Print
Sleep
Cls
endif
End Sub
Sub room2()
Dim choice As String
Print "You are in another room. Wanna go back to the first (y/n)?"
Input "> ", choice
If choice = "y" Then room = "room1
If choice = "n" Then room = "room2
If choice <> "y" And choice <> "n" Then
Print
Print "What?"
Print
Sleep
Cls
EndIf
End Sub
While running = TRUE
If room = "startmenu" Then startmenu()
If room = "room1" Then room1()
If room = "room2" Then room2()
Wend