I'm very new to Python, and (to a slightly lesser extent) programming in general. I'd like to get some experience by practicing simple-yet-functional programs, with a bit of an emphasis on games. The first game I'd like to attempt would be a simple, non-linear story, similar to those choose-your-adventure books. I don't want to start with anything too complicated, like having mapped-out directions, or interactive objects, although I do eventually want to get into stuff like that.
Python seems to me like it would be a good language for this sort of stuff. I figure I just need to use a lot of print, if/elif/else, raw_input(), and a ton and a half of variables. My problem at the moment is that I don't know how to get from one section of the story to the next. I vaguely remember reading about some language using a "goto" command for something like this, but I'm not sure how that would be handled in Python. A rough idea of what I'm trying to do (in a presumably hypothetical language) would be something like this: 0100 print "Ahead of you, you see a chasm. 0200 jump = raw_input("Do you wish to try jumping over it? Y/N") 0300 if jump = Y: 0400 goto 1700 0500 if jump = N: 0600 goto 2100 Does this make any sense? Is there some way I could do this in Python? Any and all help is definitely appreciated!
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor