• Index
  •  » Python
  •  » Can someone help me with my script

#1 2006-10-08 23:56:29

VexRed
New member
Ranking
Registered: 2006-10-08
Posts: 1
Expertise

Can someone help me with my script

Hi im pretty new to the programming game(been programming for about a week now) so i decided to encapsulate all the knowledge that i learnt so far by writing a text based adventure. Heres the crucial bit:


cave=["You enter a cave"] #list of locations
cavedirection = ["north","south"]
concave=["you enter a concave room"]
concavedirection=[ "south", "east"]

currentlocation=cave # location variable
while currentlocation == cave: # First while loop
print cave
print cavedirection
a = raw_input ("what direction do you want to go in")
currentdirection = a
if a == "north":
currentlocation=concave #location variable
if currentlocation <> cave:
break
while currentlocation == concave: # Second while loop
print concave
print concavedirection
a = raw_input ("what direction do you want to go in")
currentdirection= a
if a == "south":
currentlocation = cave #location variable
if currentlocation<>concave:
break


The programm skips from the first while loop "cave " to the second while loop "concave" but does not skip from "concave" back to "cave" again. How can I get the the second while loop to skip back to the first one again? Any Ideas?

Offline

 
  • Index
  •  » Python
  •  » Can someone help me with my script

Board footer

OPML feedsRSS feeds



Powered by WWWThreads Forum
© Copyright 2006, WWWThreads