[Tutor] A Text Adventure Problem

bob gailer bgailer at gmail.com
Sun Mar 24 23:11:19 CET 2013


On 3/24/2013 5:09 PM, John Bochicchio wrote:
> 1. I'm using the terminal to run the code. Using the command - (cd 
> python && python2 game1.py)
> 2. Using python 2.6 I believe.
> 3. I'm running Arch Linux at the moment.
> 4. I'm new to python, but I assume the error must have something to do 
> with not having a way for the program to move to the next area of the 
> code.
OK - what responses do you have to the rest of my questions and 
observations. Please respond thoroughly.

When you the the error copy and paste it directly from the terminal window.

Also in the future place your responses immediately after the item you 
are responding to rather than "top-posting".

Thank you for sending to the list as well as me.

What did you enter? I will bet is was 'window'.\
>
>     Questions:
>     1 - Did you think about what the error might mean?
>
>     Observations:
>
>     1 - The traceback does not match your code, so either you retyped
>     it or you are using some unusual way of running the program.
>
>     Compare
>     RUNNER (ROOMS, shack_front)
>     with
>     runner (ROOMS, 'shack_front')
>
>     2 - the error normally would look like KeyError: None rather than
>     keyerror= none
>
>     3 - The various room functions have at least one way out of them
>     with no return statement. The value returned in that case is None.
>
>     4 - There are many many blank lines in the program making it much
>     harder to read. In future eliminate most or all of them.
>
>     5 - Most of us do not have the patience to count down 100 lines.
>     In future flag the line with something like:
>             room = map[next] <======== line 100
>
>     6 -     quips = ["You've become a zombie and eat you pals. Douche."
>
>                  "You've died and left your comrades to fend for
>     themselves. Douche"
>                  "Your whole group dies because of you. Douche."
>                  "You've got terrible planning skills, and ruined the
>     teams chances of survival. Douche."]
>     quips is a list with one element, consisting of one string or 244
>     characters.
>     print quips[randint(0, len(quips)-1)]
>     will always print the entire string.
>     Perhaps you meant to put a comma at the end of each line?
>

-- 
Bob Gailer
919-636-4239
Chapel Hill NC

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130324/47426d80/attachment-0001.html>


More information about the Tutor mailing list