First, these while() loops and/or "break" are not necessary
if command == "look up":
print "You look up to the ceiling but nothing of any use is up there."
# break
elif command == "look down":
# while 1:
print "You look down you are sat on a bed."
# break
Your code would then loop but would never exit, so you should add an exit option and a break.
while 1:
command = raw_input("What do you do?: ")
if command == "look up":
print "You look up to the ceiling but nothing of any use is up there."
# break
elif command == "look down":
# while 1:
print "You look down you are sat on a bed."
# break
elif command == "exit":
break ## exits the while loop
print "Bye, Bye"
To get some movement you would use a common function which you would pass a direction to, and possibly distance, and the function would move the player in that direction.
while 1:
command = raw_input("What do you do?: ")
if command == "look up":
print "You look up to the ceiling but nothing of any use is up there."
# break
elif command == "look down":
# while 1:
print "You look down you are sat on a bed."
# break
elif command == "move right":
distance = raw_input("How far do you want to move? ")
move(player, int(distance), "right")
elif command == "exit":
break ## exits the while loop
woooee
Posting Maven
2,703 posts since Dec 2006
Reputation Points: 827
Solved Threads: 779
Skill Endorsements: 9
Tic-Tac-Toe or Hangman are more common starting points. Then perhaps poker or blackjack.
woooee
Posting Maven
2,703 posts since Dec 2006
Reputation Points: 827
Solved Threads: 779
Skill Endorsements: 9