-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome_inspector_adventure.py
More file actions
281 lines (230 loc) · 7.53 KB
/
home_inspector_adventure.py
File metadata and controls
281 lines (230 loc) · 7.53 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# This is a program that is basically
# a text adventure game of the glamorous
# life of a home inspector!
######
# Date: 11/30/2015
# Author: Rob Mengert
######
from sys import exit
import random
import numpy as np
#items_to_check = [[0 for x in range(1)] for y in range(1)]
items_to_check = [[],[]]
def dining_room():
room = "dining room"
print "This is the %s, what do you want to do?" % room
while True:
print "1) Go to kitchen"
print "2) Go to living room"
print "3) Check for broken stuff"
print "*) F this noise, I'm out"
choice = raw_input('> ')
if choice == '1':
kitchen()
elif choice == '2':
living_room()
elif choice == '3':
broken_stuff(room)
elif choice == '*':
quit()
else:
print "That wasn't an option (idiot), you're still in the %s, where to?" % room
def kitchen():
room = "kitchen"
print "This is the %s, what do you want to do" % room
while True:
print "1) Go to living room"
print "1) Go to dining room"
print "3) Check for broken stuff"
print "*) F this noise, I'm out"
choice = raw_input('> ')
if choice == '1':
living_room()
elif choice == '2':
dining_room()
elif choice == '3':
broken_stuff(room)
elif choice == '*':
quit()
else:
print "That wasn't an option (idiot), you're still in the %s, where to?" % room
def living_room():
room = "living room"
print "This is the %s, what do you want to do" % room
while True:
print "1) Go to the kitchen"
print "2) Go to the dining room"
print "3) Go to the basement"
print "4) Go to the hallway"
print "5) Go to the garage"
print "6) Check for broken stuff"
print "*) F this noise, I'm out"
choice = raw_input('> ')
if choice == '1':
kitchen()
elif choice == '2':
dining_room()
elif choice == '3':
basement()
elif choice == '4':
hallway()
elif choice == '5':
garage()
elif choice == '6':
broken_stuff(room)
elif choice == '*':
quit()
else:
print "That wasn't an option (idiot), you're still in the %s, where to?" % room
def hallway():
room = "hallway"
print "This is the hallway, nothing wrong here, where to?"
while True:
print "1) Bedroom 1"
print "2) Bedroom 2"
print "3) Bathroom"
print "*) F this noise, I'm out"
choice = raw_input('> ')
if choice == "1":
bedroom1()
elif choice == "2":
bedroom2()
elif choice == "3":
bathroom()
elif choice == "*":
quit()
else:
print "That wasn't an option (idiot), you're still in the %s, where to?" % room
def basement():
room = "basement"
print "This is the %s, what do you want to do" % room
while True:
print "1) Go back up to the living room"
print "2) Check for broken stuff"
print "*) F this noise, I'm out"
choice = raw_input('> ')
if choice == "1":
break
elif choice == "2":
broken_stuff(room)
elif choice == "*":
quit()
else:
print "That wasn't an option (idiot), you're still in the %s, where to?" % room
def bedroom1():
room = "bedroom1"
print "This is the %s, what do you want to do" % room
while True:
print "1) Go back into the hallway"
print "2) Check for broken stuff"
print "*) F this noise, I'm out"
choice = raw_input('> ')
if choice == "1":
break
elif choice == "2":
broken_stuff(room)
elif choice == "*":
quit()
else:
print "That wasn't an option (idiot), you're still in the %s, where to?" % room
def bedroom2():
room = "bedroom2"
print "This is the %s, what do you want to do" % room
while True:
print "1) Go back into the hallway"
print "2) Check for broken stuff"
print "*) F this noise, I'm out"
choice = raw_input('> ')
if choice == '1':
break
elif choice == '2':
broken_stuff(room)
elif choice == '*':
quit()
else:
print "That wasn't an option (idiot), you're still in the %s, where to?" % room
def bathroom():
room = "bathroom"
print "This is the %s, what do you want to do" % room
while True:
print "1) Go back into the hallway"
print "2) Check for broken stuff"
print "*) F this noise, I'm out"
choice = raw_input('> ')
if choice == '1':
break
elif choice == '2':
broken_stuff(room)
elif choice == '*':
quit()
else:
print "That wasn't an option (idiot), you're still in the %s, where to?" % room
def garage():
room = "garage"
print "This is the %s, what do you want to do" % room
while True:
print "1) Go back outside"
print "2) Go inside the house"
print "3) Check for broken stuff"
print "*) F this noise, I'm out"
choice = raw_input('> ')
if choice == "1":
start()
elif choice == "2":
living_room()
elif choice == "3":
broken_stuff(room)
elif choice == "*":
quit()
else:
print "That wasn't an option (idiot), you're still in the %s, where to?" % room
def foyer():
room = "foyer"
print "This is the foyer, nothing wrong in here. Where to?"
while True:
print "1) Dining Room"
print "*) F this noise, I'm out"
choice = raw_input('> ' )
if choice == "1":
dining_room()
elif choice == '*':
quit()
else:
print "That wasn't an option (idiot), you're still in the %s, where to?" % room
def quit():
print "This home inspector stuff is driving me to drink, meet you at the bar"
print "Oh yeah, here's what's wrong with the place"
#i=0
#int(i)
#for row in items_to_check:
# print items_to_check[[i],[i]]
exit(0)
def start():
print "You approach the house that needs an inspection"
print "There is a front door or a garage door"
print "Which do you open?"
choice = raw_input('> ')
if "garage" in choice:
garage()
elif "front" in choice:
foyer()
else:
print "That wasn't a way to get inside the house!"
def broken_stuff(room):
#print "recording all of the broken stuff in a room here"
broken_items = []
broken_items.append("electrical")
broken_items.append("plumbing")
broken_items.append("water damage")
broken_items.append("busted door")
broken_items.append("broken light")
broken_items.append("bow chicka wow wow residue")
broken_items.append("ghost")
broken_items.append("entrance to another dimension")
broken_items.append("being rejected by the house")
broken_item = broken_items[random.randint(0,8)]
#items_to_check.append([[room]broken_items[random.randint(0,8)]])
items_to_check[0].append(room)
items_to_check[1].append(broken_item)
print "Well, it looks like the %s has %s problems" % (room, broken_item)
start()