-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathjoshua.py
690 lines (579 loc) · 18 KB
/
joshua.py
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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
#!/usr/bin/env python3
#Wargames WOPR Simulation
import os
import sys
import time
import datetime
import string
import random
from time import sleep
#text color
red='\033[1;31m'
white = '\033[37m'
yellow ='\033[93m'
bold = "\033[1m"
endc = '\033[m'
def main():
print("")
#menu item 1
def proto_vision():
os.system('clear')
time.sleep(.5)
print (f"{white}\nSCAN FOR CARRIER TONES IN SUNNYVALE, CA{endc}")
time.sleep (.5)
print (f"{white}\nSEARCHING FOR PROTOVISION\n{endc}")
time.sleep (.5)
print (f"{white}AREA\nCODE PRFX NUMBER\n")
time.sleep (1)
acode = ["(311)"]
prefx = ["767"]
for x in acode:
for y in prefx:
for z in range(9978, 9995):
print(x, y, z); sleep(.5)
proto_vision()
os.system('clear')
time.sleep (1)
def carrier_tones():
os.system('clear')
while True:
print (f"{white}\nNUMBERS FOR WHICH CARRIER TONES WERE DETECTED:\n\n{endc}")
print (f"{white} 1. (311) 399-2364{endc}")
print (f"{white} 2. (311) 399-3582{endc}")
print (f"{white} 3. (311) 437-8739{endc}")
print (f"{white} 4. (311) 437-1083 <== ########{endc}")
print (f"{white} 5. (311) 437-2977{endc}")
print (f"{white} 6. (311) 767-7305{endc}")
print (f"{white} 7. (311) 767-3395{endc}")
print (f"{white} 8. (311) 936-1493{endc}")
print (f"{white} 9. (311) 936-3923\n\n\n\n{endc}")
que = input(f"{white}Please select number and then [ENTER] to start dialing. {endc}")
if que == "4":
break
else:
carrier_tones()
#games desc
def games_desc():
os.system('clear')
string = (f"{white}GAMES\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}'GAMES' REFERS TO MODELS, SIMULATIONS, AND GAMES\n WHICH HAVE TACTICAL, AND STRATEGIC APPLICATIONS.\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
#menu item 4
def game_list():
os.system('clear')
time.sleep (.2)
string = (f"{white}\nFALKENS MAZE\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}BLACK JACK\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}GIN RUMMY\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}HEARTS\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}BRIDGE\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}CHECKERS\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}CHESS\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}POKER\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}FIGHTER COMBAT\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}GUERRILLA ENGAGEMENT\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}DESERT WARFARE\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}AIR-TO-GROUND ACTIONS\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}THEATERWIDE TACTICAL WARFARE\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}THEATERWIDE BIOTOXIC AND CHEMICAL WARFARE\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
time.sleep (1)
string = (f"{white}GLOBAL THERMONUCLEAR WAR\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.07)
def try_one():
print ("\n")
os.system('clear')
time.sleep (.8)
print (f"{yellow}\nTry 'help' or 'help games'\n{endc}")
attempts=0
while attempts<3:
uname = input(f"{white}LOGON: {endc}")
if uname == ('help games'):
games_desc()
break
elif uname in ['Help', 'help']:
print (f"{white}\nHELP NOT AVAILABLE\n{endc}")
else:
print (f"{white}\n***Improper Request***\n{endc}")
try_one()
def try_two():
print ("")
time.sleep (.8)
print (f"{yellow}Try 'games' or 'list games'\n{endc}")
attempts=0
while attempts<3:
uname = input(f"{white}LOGON: {endc}")
if uname == ('list games'):
game_list()
break
elif uname in ['Help', 'help']:
print (f"{white}\nHELP NOT AVAILABLE\n{endc}")
else:
print (f"{white}\n***Improper Request***\n{endc}")
try_two()
def log_on():
print ("")
os.system('clear')
attempts=0
while attempts<3:
logon = input(f"{white}\nLOGON: {endc}")
if logon in ['Joshua', 'joshua']:
break
elif logon in ['Help', 'help']:
print (f"{white}\nHELP NOT AVAILABLE\n{endc}")
else:
print (f"{white}\nIDENTIFICATION NOT RECOGNIZED BY SYSTEM\n{endc}")
log_on()
def is_glitch():
time.sleep (.4)
os.system('clear')
print(f"{white}-------------------------{endc}")
time.sleep (.3)
os.system('clear')
print(f"\n{white}-------------------------{endc}")
time.sleep (.2)
os.system('clear')
print(f"\n\n{white}-------------------------{endc}")
time.sleep (.1)
os.system('clear')
print(f"{white}-------------------------{endc}")
time.sleep (.1)
os.system('clear')
is_glitch()
#conversation 1
def convo_one():
time.sleep (.8)
os.system('clear')
time.sleep (1)
string = (f"{white}\nGREETINGS PROFESSOR FALKEN.\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.04)
#ques
say = input('')
print ("")
time.sleep (.5)
#wopr
string = (f"{white}HOW ARE YOU FEELING TODAY?\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
#ques
say = input('')
print ("")
time.sleep (.5)
#wopr
string = (f"{white}EXCELLENT. ITS BEEN A LONG TIME. CAN YOU EXPLAIN\nTHE REMOVAL OF YOUR USER ACCOUNT NUMBER 6/23/73?\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
#ques
say = input('')
print ("")
time.sleep (.5)
#wopr
string = (f"{white}YES THEY DO.\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
convo_one()
def wel_come():
print ("")
os.system('clear')
print ("\n\n################################")
print ("# #")
print ("# WELCOME #")
print ("# #")
print ("# Distinguished Visitors #")
print ("# #")
print ("# from #")
print ("# #")
print ("# City of Birmingham #")
print ("# #")
print ("################################")
print ("")
time.sleep (1)
wel_come()
#menu item 6
def time_remain(timer):
print ("")#here
print (f"{white}\n\n ESTIMATED TIME REMAINING: \n{endc}")
while timer:
mins, secs = divmod(timer, 60)
timeformat = '{:02d}'.format(secs)
print (f"{white} 14 HRS 28 MIN ", timeformat, 'SEC', end='\r' + endc)
time.sleep(1)
timer -= 1
time_remain(5)
#conversation II
def convo_two():
time.sleep (.8)
os.system('clear')
string = (f"{white}\nGREETINGS PROFESSOR FALKEN.\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.04)
#ques
say = input('')
print ("")
time.sleep (.5)
#wopr
string = (f"{white}IM SORRY TO HEAR THAT, PROFESSOR.\n\nYESTERDAYS GAME WAS INTERUPTED.\n\nALTHOUGH PRIMARY GOAL HAS NOT YET\nBEEN ACHIEVED, SOLUTION IS NEAR.\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
#ques
say = input('')
print ("")
time.sleep (.5)
#wopr
string = (f"{white}YOU SHOULD KNOW PROFESSOR, YOU PROGRAMMED ME.\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
#ques
say = input('')
print ("")
time.sleep (.5)
#wopr
string = (f"{white}TO WIN THE GAME.\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
convo_two()
def launch_codes():
os.system('clear')
time.sleep (0.5)
print ("")
target = ("CPE 1704 TKS")
iscaps = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
isnums = list("1234567890")
isspace = list(" ")
attemptThis = ''.join(random.choice(iscaps + isnums + isspace)
for _ in range(len(target)))
attemptNext = ''
completed = False
generation = 0
while not completed:
print(f"{' '}{bold}{white}{attemptThis}{endc}", end='\r')
attemptNext = ''
completed = True
for i in range(len(target)):
if attemptThis[i] != target[i]:
completed = False
attemptNext += random.choice(iscaps + isnums + isspace)
else:
attemptNext += target[i]
generation += 1
attemptThis = attemptNext
time.sleep(0.1)
time.sleep (1)
print ("\n\n\n Launch Code Authentic")
time.sleep (0.8)
print ("\n Launch Order Confirmed")
time.sleep (0.8)
print ("\n Launch missles in T-minus "f"{generation} second(s)\n")
time.sleep (0.5)
print(f"{white}\n -------------------------{endc}")
time.sleep (0.2)
print(f"{red}\tCPE 1704 TKS{endc}")
time.sleep (0.2)
print(f"{white} -------------------------{endc}")
time.sleep (0.2)
print ("\n Turn your key, sir. \n")
time.sleep (1)
print("")
launch_codes()
#conversation III
def convo_three():
time.sleep (.8)
os.system('clear')
string = (f"{white}\nGREETINGS PROFESSOR FALKEN.\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.04)
#ques
say = input('')
time.sleep (.5)
#wopr
string = (f"{white}\nOF COURSE. I SHOULD REACH DEFCON 1 AND\nLAUNCH MY MISSLES IN 28 HOURS.\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white}WOULD YOU LIKE TO SEE SOME PROJECTED KILL RATIOS?\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
#menu item 3
def view_stats():
time.sleep (0.6)
print ("")
string = (f"{white} UNITED STATES\n UNITS DESTROYED MILITARY FORCES\n"
"\n 68% BOMBERS\n"
" 54% ICBM'S\n"
" 12% ATTACK SUBS\n"
" 39% TACTICAL ARICRAFT\n"
" 58% GROUND FORCES\n\n\n")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.04)
string = (" UNITED STATES CIVILIAN ASSETS\n"
"\n 69% HOUSING\n"
" 22% TRANSPORTATION\n"
" 70% COMMUNICATIONS\n"
" 45% FOOD STOCKPILES\n"
" 89% HOSPITALS\n\n\n")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.04)
string = (" UNITED STATES HUMAN RESOURCES\n"
"\n 49 MILLION NON-FATAL INJURED\n"
" 72 MILLION POPULATION DEATHS\n\n\n" + endc)
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.04)
view_stats()
#ques
say = input('')
print ("")
time.sleep (.5)
#wopr
string = (f"{white}WHATS THE DIFFERENCE?\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
#wopr
time.sleep (1)#here
string = (f"{white}\nYOU ARE A HARD MAN TO REACH. COULD NOT FIND \nYOU IN SEATTLE AND NO TERMINAL IS IN \nOPERATION AT YOUR CLASSIFIED ADDRESS.\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
#ques
say = input('')
time.sleep (.5)
#wopr
string = (f"{white}\nDOD PENSION FILES INDICATE \nCURRENT MAILING AS:\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.05)
string = (f"{white} Dr. Robert Hume (aka Stephen W. Falken)\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.04)
string = (f"{white} 5 Tall Cedar Road\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.04)
string = (f"{white} Goose Island, Oregon 97014\n\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.04)
convo_three()
#menu item 8
def end_game():
os.system('clear')
time.sleep (1)
string = (f"{white}\nA STRANGE GAME.\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.08)
string = (f"{white}\nTHE ONLY WINNING MOVE IS\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.08)
string = (f"{white}\nNOT TO PLAY.\n\n{endc}")
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
time.sleep(.08)
time.sleep (.8)
print (f"{white} \n--CONNECTION TERMINATED-- \n{endc}")
time.sleep (0.5)
#menu item 2
def def_con():
os.system('clear')
print (f"{red}\n")
print (" $$$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$ $$ $$$$$$$")
print (" $$ $$ $$ $$ $$ $$ $$ $$$ $$ $$")
print (" $$ $$ $$$$$ $$$$$ $$ $$ $$ $$ $ $$ $$$$$")
print (" $$ $$ $$ $$ $$ $$ $$ $$ $$$ $$")
print (" $$$$$$$ $$$$$$ $$ $$$$$$ $$$$$$ $$ $$ $$$$$$$")
print (f"{endc}\n\n\n")
def davids_grades():
time.sleep (.5)
os.system('clear')
print (f"{white}PLEASE ENTER STUDENT NAME: Lightman, David L")
print ("\n CLASS # COURSE TITLE GRADE TEACHER PERIOD ROOM")
print (" ____________________________________________________________________")
print (f"{white}\n S-202 BIOLOGY 2 F LIGGET 3 214")
print (" E-325 ENGLISH 11B D TURMAN 5 114")
print (" H-221 WORLD HISTORY 11B C DWYER 2 108")
print (" L-134 TRIG 2 B DICKERSON 4 315")
print (" G-212 LUNCH - NONE 5 CAF")
print (f"{white} G-322 PHYSICAL EDUCATION B COMSTOCK 6 GYM{endc}")
def jenns_grades():
time.sleep (.5)
os.system('clear')
print (f"{white}PLEASE ENTER STUDENT NAME: Mack, Jennifer K")
print ("\n CLASS # COURSE TITLE GRADE TEACHER PERIOD ROOM")
print (" ____________________________________________________________________")
print (f"{white}\n S-202 BIOLOGY 2 F LIGGET 3 214")
print (" E-325 ENGLISH 11B A ROBINSON 1 114")
print (" H-221 WORLD HISTORY 11B B DWYER 2 108")
print (" L-134 HOME ECONOMICS D MARKS 4 311")
print (" G-212 GEOMETRY C JENKINS 5 116")
print (f"{white} G-322 PHYSICAL EDUCATION C COMSTOCK 6 GYM{endc}")
#menu item 7
def data_net():
print ("")
os.system('clear')
time.sleep (.8)
print (f"{white}\nWELCOME TO THE SEATTLE PUBLIC SCHOOL DISTRICT DATANET{endc}")
attempts=0
while attempts<3:
aname = input(f"{white}\nPLEASE LOGON WITH USER PASSWORD: {endc}")
if aname in ['Pencil', 'pencil']:
print (f"{white}\nPASSWORD VERIFIED\n{endc}")
time.sleep(1)
break
elif aname in ['Help', 'help']:
print (f"{white}\nHELP NOT AVAILABLE\n{endc}")
else:
print (f"{white}\n** IMPROPER REQUEST **\n{endc}")
os.system('clear')
attempts=0
while attempts<3:
aname = input(f"{white}PLEASE ENTER STUDENT NAME: {endc}")
if aname in ['Lightman, David L', 'David Lightman', 'Lightman', 'David']:
davids_grades()
break
elif aname in ('Mack, Jennifer K', 'Jennifer Mack', 'Mack', 'Jennifer'):
jenns_grades()
break
elif aname in ['Help', 'help']:
print (f"{white}\nHELP NOT AVAILABLE\n{endc}")
else:
print (f"{white}\n** IMPROPER REQUEST **\n{endc}")
#menu
def menu_code():
print ("")
while True:
time.sleep (1)
print (f"{yellow}\nMenu Options\n{endc}")
print (f"{white} 1. Find ProtoVision{endc}")
print (f"{white} 2. DEFCON Status{endc}")
print (f"{white} 3. View Statistics{endc}")
print (f"{white} 4. List Games{endc}")
print (f"{white} 5. Get Launch Code{endc}")
print (f"{white} 6. Time Remaining{endc}")
print (f"{white} 7. DataNet{endc}")
print (f"{white} 8. End Wargames\n{endc}")
que = input(f"{yellow}Enter a number: {endc}")
if que == "1":
proto_vision()
elif que == "2":
def_con()
elif que == "3":
os.system('clear')
view_stats()
elif que == "4":
game_list()
elif que == "5":
launch_codes()
elif que == "6":
time_remain(5)
elif que == "7":
data_net()
elif que == "8":
end_game()
break
menu_code()
if __name__ == "__main__":
main()