1.11M Members

How do you go to different areas?

 
0
 

I am developing a text based rpg, but do not know how to go to different def statement, but it says it is not defined. Help?

 
0
 

Can you post your code ?

 
0
 

uhhhh... on a different computer

 
1
 

uhhhh... on a different computer

No problem, we can wait.

do not know how to go to different def statement,

As in:

def printMenu():
    print('1: Option 1\n2: Option 2\n3: exit')
def menu():
    answer = ""
    while(1):
        printMenu()
        answer = input("Choose: ")
        if (answer == "1"):
            #do stuff
            print("option 1")
        elif (answer=="2"):
            #do stuff for answer 2
            print("option 2")
        elif (answer=="3"): break
        else: print('Invalid command')

menu()
 
0
 

yes

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article