-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathblackout.c
395 lines (325 loc) · 12.6 KB
/
blackout.c
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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
// Blackout
// Ariel Gross, Jonathan Daniel & Steve You
#include <stdio.h>
#include <unistd.h>
/* STORY: You are in the middle of a blackout, and you have walked into the Empire State Building. You see 3 doors, on the left, middle and right. Which one do you go through? (Repeat 10 times). You then enter a room and a man says that he is going to kill you. He gives you four choices... */
void introduction();
void doors();
void endingScenarios();
void printBigLetters();
int main() {
introduction();
doors();
endingScenarios();
}
void introduction() {
char start;
printf("===============================================================================\n");
usleep(200000);
printf("BBBBBBB LLL AAAAAA CCCCCC KK KK OOOOOO UU UU TTTTTTTTTT\n");
usleep(200000);
printf("BB BB LLL AA AA CC CC KK KK OO OO UU UU TT \n");
usleep(200000);
printf("BB BB LLL AA AA CC KK KK OO OO UU UU TT \n");
usleep(200000);
printf("BBBBBBB LLL AAAAAAAA CC KKKK OO OO UU UU TT \n");
usleep(200000);
printf("BB BB LLL AA AA CC KK KK OO OO UU UU TT \n");
usleep(200000);
printf("BB BB LLL AA AA CC CC KK KK OO OO UU UU TT \n");
usleep(200000);
printf("BBBBBBB LLLLLLLL AA AA CCCCCC KK KK OOOOOO UUUUUU TT \n");
usleep(200000);
printf("===============================================================================\n");
usleep(200000);
printf("\n");
printf("Type x to begin: ");
scanf("%s", &start);
printf("\nIt is the middle of the night.\n");
usleep(900000);
printf("You are walking home.\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("Bzzzzzzzzzzzzzzz (buzzing sound)\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("Sketched out, you quickly went inside the nearby building.\n");
usleep(900000);
printf("the * lights * are bright inside.\n");
usleep(900000);
printf("You feel safe now.\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("...\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("Suddenly, the lights go out!\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("You quickly get your phone out and use it for light.\n");
usleep(900000);
printf("The doors to go back outside are locked.\n");
usleep(900000);
printf("\n");
usleep(900000);
}
void doors() {
int door;
printf(" _________ _________ _________ \n");
usleep(250000);
printf(" | _______ | | _______ | | _______ | \n");
usleep(250000);
printf(" || _ A _ || || _ B _ || || _ C _ || \n");
usleep(250000);
printf(" ||| | | ||| ||| | | ||| ||| | | ||| \n");
usleep(250000);
printf(" |||_| |_||| |||_| |_||| |||_| |_||| \n");
usleep(250000);
printf(" || _ _o|| || _ _o|| || _ _o|| \n");
usleep(250000);
printf(" ||| | | ||| ||| | | ||| ||| | | ||| \n");
usleep(250000);
printf(" |||_| |_||| |||_| |_||| |||_| |_||| \n");
usleep(250000);
printf(" ||_______|| ||_______|| ||_______|| \n");
usleep(250000);
printf("________/___________\\________/___________\\________/___________\\________\n");
usleep(250000);
printf(" |___________| |___________| |___________| \n");
usleep(250000);
printf(" /_____________\\ /_____________\\ /_____________\\ \n");
usleep(250000);
printf(" |_____________| |_____________| |_____________| \n\n");
usleep(900000);
printf("You see three doors in front of you, which door would you pick?\n");
usleep(900000);
printf("\n");
usleep(900000);
printf(" Enter 1) for door A\n");
usleep(500000);
printf(" Enter 2) for door B\n");
usleep(500000);
printf(" Enter 3) for door C\n");
usleep(500000);
printf("\n> ");
scanf("%d", &door);
for (int time = 0; time < 2; time++) {
printf("\nYou walked in another room that has three doors! Pick again!\n");
usleep(900000);
printf("\n");
usleep(900000);
printf(" Enter 1) for door A\n");
usleep(500000);
printf(" Enter 2) for door B\n");
usleep(500000);
printf(" Enter 3) for door C\n");
usleep(500000);
printf("\n> ");
scanf("%d", &door);
}
if (door == 1 || door == 2 || door == 3) {
printf("\n");
usleep(900000);
printf("...\n");
usleep(900000);
printf("\n");
usleep(900000);
}
return;
}
void endingScenarios() {
int choice = 0;
printf("You walk into a dark room.\n");
usleep(1000000);
printf("\n");
usleep(1000000);
printf("Immediately, you feel a gun pointed at your forehead.\n");
usleep(1000000);
printf("The man holding the gun begin to speak.\n");
usleep(1000000);
printf("\n");
usleep(900000);
printf(" \"You can jump out the window.\"\n");
usleep(900000);
printf(" \"Or sit in an extremely powerful electric chair.\"\n");
usleep(900000);
printf(" \"Or be shot by this gun.\"\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("However, the door is wide open, so maybe you could still make a run for it.\n");
usleep(1000000);
printf("\n");
usleep(1000000);
printBigLetters();
printf("\n");
usleep(900000);
printf(" Enter 1) Jump out the window\n");
usleep(900000);
printf(" Enter 2) Sit in an extremely powerful electric chair\n");
usleep(900000);
printf(" Enter 3) Be shot by his gun\n");
usleep(900000);
printf(" Enter 4) Run away towards the door\n");
usleep(900000);
printf("\n> ");
scanf("%d", &choice);
while (choice < 1 || choice > 4) {
printf("Invalid Input. Please try again.\n");
scanf("%d", &choice);
}
if (choice == 1) {
printf("\nYou make a run to the window and jump out.\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("As you fall, you begin to think about your life...\n");
usleep(900000);
printf("your loved ones...\n");
usleep(900000);
printf("AND THE FACT THAT YOU LEFT THE FRONT DOOR UNLOCKED!\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("This is the last thought you have as you become one with the cement.\n");
usleep(900000);
}
else if (choice == 2) {
printf("\nHe straps you into the electric chair...\n");
usleep(900000);
printf("and he flips the switch.\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("Nothing happens.\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("He keeps flipping the switch.\n");
usleep(900000);
printf("Increasingly frustrated, he slams his gun on a table.\n");
usleep(900000);
printf("The bullet fires, bounces off the wall, and kills him.\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("You walk away free.\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("Oh yeah, there is no electricity during a blackout.\n");
usleep(900000);
}
else if (choice == 3) {
printf("\nHe shoots you with his gun, and you die from the point-blank shot.\n");
usleep(900000);
}
else if (choice == 4) {
printf("\nYou kick the man in his crotch and run.\n");
usleep(900000);
printf("He is in so much pain that he can't chase after you and get a clean shot.\n");
usleep(900000);
printf("You run out to the street and think you're free...\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("until you get hit by a taxi driver.\n");
usleep(900000);
printf("\n");
usleep(900000);
printf("You die from your injuries.\n");
usleep(900000);
}
printf("\n");
usleep(900000);
printf("=================================== THE END ===================================\n\n");
usleep(900000);
return;
}
void printBigLetters() {
printf("`8.`888b ,8' 8 8888 8 .8. 8888888 8888888888 \n");
usleep(150000);
printf(" `8.`888b ,8' 8 8888 8 .888. 8 8888 \n");
usleep(150000);
printf(" `8.`888b ,8' 8 8888 8 :88888. 8 8888 \n");
usleep(150000);
printf(" `8.`888b .b ,8' 8 8888 8 . `88888. 8 8888 \n");
usleep(150000);
printf(" `8.`888b 88b ,8' 8 8888 8 .8. `88888. 8 8888\n");
usleep(150000);
printf(" `8.`888b .`888b,8' 8 8888 8 .8`8. `88888. 8 8888\n");
usleep(150000);
printf(" `8.`888b8.`8888' 8 8888888888888 .8' `8. `88888. 8 8888\n");
usleep(150000);
printf(" `8.`888`8.`88' 8 8888 8 .8' `8. `88888. 8 8888\n");
usleep(150000);
printf(" `8.`8' `8,`' 8 8888 8 .888888888. `88888. 8 8888\n");
usleep(150000);
printf(" `8.` `8' 8 8888 8 .8' `8. `88888. 8 8888\n\n");
usleep(500000);
printf("`8.`888b ,8' 8 8888 8 8888 8 8888\n");
usleep(150000);
printf(" `8.`888b ,8' 8 8888 8 8888 8 8888 \n");
usleep(150000);
printf(" `8.`888b ,8' 8 8888 8 8888 8 8888\n");
usleep(150000);
printf(" `8.`888b .b ,8' 8 8888 8 8888 8 8888 \n");
usleep(150000);
printf(" `8.`888b 88b ,8' 8 8888 8 8888 8 8888\n");
usleep(150000);
printf(" `8.`888b .`888b,8' 8 8888 8 8888 8 8888 \n");
usleep(150000);
printf(" `8.`888b8.`8888' 8 8888 8 8888 8 8888 \n");
usleep(150000);
printf(" `8.`888`8.`88' 8 8888 8 8888 8 8888 \n");
usleep(150000);
printf(" `8.`8' `8,`' 8 8888 8 8888 8 8888 \n");
usleep(150000);
printf(" `8.` `8' 8 8888 8 888888888888 8 888888888888 \n\n");
usleep(500000);
printf("`8.`8888. ,8' ,o888888o. 8 8888 88\n");
usleep(150000);
printf(" `8.`8888. ,8. 8888 `88. 8 8888 88\n");
usleep(150000);
printf(" `8.`8888. ,8,8 8888 `8b 8 8888 88\n");
usleep(150000);
printf(" `8.`8888.,8'88 8888 `8b 8 8888 88\n");
usleep(150000);
printf(" `8.`88888' 88 8888 88 8 8888 88\n");
usleep(150000);
printf(" `8. 8888 88 8888 88 8 8888 88\n");
usleep(150000);
printf(" `8 8888 88 8888 ,8P 8 8888 88\n");
usleep(150000);
printf(" 8 8888 `8 8888 ,8P ` 8888 ,8P\n");
usleep(150000);
printf(" 8 8888 ` 8888 ,88' 8888 ,d8P\n");
usleep(150000);
printf(" 8 8888 `8888888P' `Y88888P' \n\n");
usleep(500000);
printf("8 888888888o. ,o888888o.\n");
usleep(150000);
printf("8 8888 `^888. . 8888 `88.\n");
usleep(150000);
printf("8 8888 `88. ,8 8888 `8b \n");
usleep(150000);
printf("8 8888 `88 88 8888 `8b\n");
usleep(150000);
printf("8 8888 88 88 8888 88\n");
usleep(150000);
printf("8 8888 88 88 8888 88 \n");
usleep(150000);
printf("8 8888 ,88 88 8888 ,8P \n");
usleep(150000);
printf("8 8888 ,88' `8 8888 ,8P \n");
usleep(150000);
printf("8 8888 ,o88P' ` 8888 ,88' \n");
usleep(150000);
printf("8 888888888P' `8888888P'\n");
usleep(500000);
}