-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadventure.py
More file actions
46 lines (45 loc) · 1.35 KB
/
adventure.py
File metadata and controls
46 lines (45 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
userRoom = 'R1'
print ("You are in Room 1.")
print ("Press L,R,B,F to move.")
ip = raw_input()
while ( ip != "N" ):
if ( userRoom == "R1" and ip == "F"):
userRoom = "R2"
print ("You are in Room 2.")
elif ( userRoom == "R2" and ip == "B"):
userRoom = "R1"
print ("You are in Room 1.")
elif ( userRoom == "R2" and ip == "F"):
userRoom = "R3"
print ("You are in Room 3.")
elif ( userRoom == "R2" and ip == "R"):
userRoom = "R4"
print ("You are in Room 4.")
elif ( userRoom == "R3" and ip == "B"):
userRoom = "R2"
print ("You are in Room 2.")
elif ( userRoom == "R3" and ip == "R"):
userRoom = "R4"
print ("You are in Room 4.")
elif ( userRoom == "R4" and ip == "R"):
userRoom = "R3"
print ("You are in Room 3.")
elif ( userRoom == "R4" and ip == "L"):
userRoom = "R2"
print ("You are in Room 2.")
elif ( userRoom == "R4" and ip == "B"):
userRoom = "R5"
print ("You are in Room 5.")
elif ( userRoom == "R5" and ip == "L"):
userRoom = "R1"
print ("You are in Room 1.")
elif ( userRoom == "R5" and ip == "B"):
userRoom = "R6"
print ("You are in Room 6.")
elif ( userRoom == "R6" and ip == "F"):
userRoom = "R5"
print ("You are in Room 5.")
else:
print ("It's wall you can't move in that direction.")
print ("Press L,R,B,F to move or Press N to exit game.")
ip = raw_input()