#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0

    Noob Question - Python text adventure help


    I'm new to python, and have begun writing a text adventure. I've done just a bit, and tried running it, and I get through the first frame and choice, but on the second choice I get this error "Traceback: (Most recent call last)
    file "game1.py", line 104, in <module>
    RUNNER (ROOMS, shack_front)
    file "game1.py", line 100 in runner
    room = map[next]
    keyerror= none

    I don't know what to do to fix it . Any Ideas? Not sure how to properly upload it on the forums however
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,854
    Rep Power
    481
    Follow instructions, please, at my signature for posting code.

    none is spelled None if you want the python word None.

    Also, since `next' is builtin, hiding the name with your own variable named `next' is usually a bad idea.

    room = map[next]

    Hmm. `map' is also builtin. Granted, maps can be useful for text based adventure games. `map' is a useful function.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    13
    Rep Power
    0
    Never mind - I was wrong.
    Last edited by The_Python_Pro; March 25th, 2013 at 05:03 AM. Reason: Wrong, Sorry

IMN logo majestic logo threadwatch logo seochat tools logo