File tree 4 files changed +30
-22
lines changed
4 files changed +30
-22
lines changed Original file line number Diff line number Diff line change 1
- .DS_Store
1
+ .DS_Store
2
+ __pycache__
3
+ test.py
Original file line number Diff line number Diff line change
1
+ entrance = {
2
+ "look" : {
3
+ "output" : "You are in the entrance area. Behind you is a broken elevator. In front of you a leather couch. The hallway continues to the [east]." ,
4
+ "next_location_id" : None
5
+ },
6
+ "east" : {
7
+ "output" : "You go east." ,
8
+ "next_location_id" : "hallway1"
9
+ },
10
+ }
Original file line number Diff line number Diff line change
1
+ hallway = {
2
+ "look" : {
3
+ "output" : "You are in a hallway with a table. The table has a bowl of apples on it. Maybe you can [take] one? The way returns [west]." ,
4
+ "next_location_id" : None
5
+ },
6
+ "west" : {
7
+ "output" : "You go west." ,
8
+ "next_location_id" : "entrance"
9
+ },
10
+ }
Original file line number Diff line number Diff line change
1
+ from locations .entrance import entrance
2
+ from locations .hallway import hallway
3
+
1
4
welcome_message = """Welcome to CODE World Campus!
2
5
3
6
You can navigate with directions such as 'east'.
8
11
"""
9
12
10
13
locations = {
11
- "entrance" : {
12
- "look" : {
13
- "output" : "You are in the entrance area. Behind you is a broken elevator. In front of you a leather couch. The hallway continues to the [east]." ,
14
- "next_location_id" : None
15
- },
16
- "east" : {
17
- "output" : "You go east." ,
18
- "next_location_id" : "hallway1"
19
- },
20
- },
21
- "hallway1" : {
22
- "look" : {
23
- "output" : "You are in a hallway with a table. The table has a bowl of apples on it. Maybe you can [take] one? The way returns [west]." ,
24
- "next_location_id" : None
25
- },
26
- "west" : {
27
- "output" : "You go west." ,
28
- "next_location_id" : "entrance"
29
- },
30
- }
14
+ "entrance" : entrance ,
15
+ "hallway1" : hallway
31
16
}
32
17
33
18
current_location = locations ["entrance" ]
52
37
print (current_location ["look" ]["output" ])
53
38
54
39
else :
55
- print ("Please enter a valid command." )
40
+ print ("Please enter a valid command." )
41
+
You can’t perform that action at this time.
0 commit comments