[Tutor] Unknown Cause of Error

Amit Saha amitsaha.in at gmail.com
Sat May 11 04:17:42 CEST 2013


On Sat, May 11, 2013 at 12:13 PM, Jack Little <jacklittlemc at yahoo.com> wrote:
> I have a slight problem. My program will not open. On top of that, I have
> written similar programs all to no avail. I am creating a text adventure and
> want there to be different rooms. Here is my code:
>
>
> def menu():
>     print "Welcome to Tomb Explorer!"
>     print "A game of Exploration from Bulldog Development"
>     print "Press [1] to Play or [2] to Exit"
>     menu1=raw_input(" >> ")
>     if menu1== "2":
>         quit()
>     if menu1== "1":
>         room1()
>     menu()

You are not calling your function: menu(). Just move the menu() ( your
last line) to the left:

def menu():
    print "Welcome to Tomb Explorer!"
    print "A game of Exploration from Bulldog Development"
    print "Press [1] to Play or [2] to Exit"
    menu1=raw_input(" >> ")
    if menu1== "2":
        quit()
    if menu1== "1":
        room1()

 menu()

HTH,Amit.


--
http://echorand.me


More information about the Tutor mailing list