-
Notifications
You must be signed in to change notification settings - Fork 0
/
Graph.py
544 lines (513 loc) · 19.4 KB
/
Graph.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
import time, WordCore, Clear, ColorSplash
from json_system import *
def inf_graph(): # Visuals for population infection
with open("UniData.txt", 'r') as f:
variables = json.load(f)
infect = int((float(variables["infected"])/variables["limit"])*100)
inf = "["
for i in range(infect): # Visual for infection
inf += "|"
for i in range(100-int(infect)): # Visual for non-variables["infected"]
inf += "."
inf2 = str(inf) + "] " + str(infect) + "% Infected"
print("Population Infected")
print(inf2)
print("\n")
WordCore.word_corex("Infected |", str(variables["infected"]) + " People Infected")
print("\n")
time.sleep(1)
def color_inf_graph(): # Visuals for population infection
with open("UniData.txt", 'r') as f:
variables = json.load(f)
infect = int((float(variables["infected"])/variables["limit"])*100)
inf = "["
for i in range(infect): # Visual for infection
inf += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
for i in range(100-int(infect)): # Visual for non-variables["infected"]
inf += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
inf2 = str(inf) + "] " + str(infect) + "% Infected"
print("Population Infected")
print(inf2)
print("\n")
WordCore.word_corex("Infected |", str(variables["infected"]) + " People Infected")
print("\n")
time.sleep(1)
def color_inf_graph_mini():
with open("UniData.txt", 'r') as f:
variables = json.load(f)
infect = int((float(variables["infected"])/variables["limit"]) * 10)
inf = "["
inf_t = 0
for i in range(infect): # Visual for infection
inf += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
inf_t += 10
for t in range(10-int(infect)): # Visual for non-variables["infected"]
inf += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
inf2 = str(inf) + "] " + str(inf_t) + "% Infected"
print(inf2)
def inf_graph_mini():
with open("UniData.txt", 'r') as f:
variables = json.load(f)
infect = int((float(variables["infected"])/variables["limit"]) * 10)
inf = "["
inf_t = 0
for i in range(infect): # Visual for infection
inf += "|"
inf_t += 10
for t in range(10-int(infect)): # Visual for non-variables["infected"]
inf += "."
inf2 = str(inf) + "] " + str(inf_t) + "% Infected"
print(inf2)
def cure_progress(): #notifies if the cure is a threat or not
with open("UniData.txt", 'r') as f:
variables = json.load(f)
variables["cure_percent"] = (float(variables["cure"])/1000) * 100
cur_graph()
if variables["cure_percent"] < int(10):
print("The cure is not yet a threat\n")
elif variables["cure_percent"] < int(25):
print("The cure is becoming an annoyance\n")
elif variables["cure_percent"] < int(50):
print("A threat ensues\n")
elif variables["cure_percent"] < int(75):
print("The cure is a threat\n")
elif variables["cure_percent"] < int(90):
print("The cure has become a severe threat\n")
elif variables["cure_percent"] < int(99):
print("You are screwed\n")
else:
print("You will see this message if an uncorrectable error has occurred")
time.sleep(1)
def color_cure_progress(): #notifies if the cure is a threat or not
with open("UniData.txt", 'r') as f:
variables = json.load(f)
variables["cure_percent"] = (float(variables["cure"])/1000) * 100
color_cur_graph()
print(ColorSplash.Green_Blackxx)
if variables["cure_percent"] < int(10):
print("The cure is not yet a threat\n")
elif variables["cure_percent"] < int(25):
print("The cure is becoming an annoyance\n")
elif variables["cure_percent"] < int(50):
print("A threat ensues\n")
elif variables["cure_percent"] < int(75):
print("The cure is a threat\n")
elif variables["cure_percent"] < int(90):
print("The cure has become a severe threat\n")
elif variables["cure_percent"] < int(99):
print("You are screwed\n")
else:
print("You will see this message if an uncorrectable error has occurred")
print(ColorSplash.Reset)
time.sleep(1)
def cur_graph(): #Displays the percent of cure completion
with open("UniData.txt", 'r') as f:
variables = json.load(f)
cur = "["
curer = int(variables["cure_percent"])
for i in range(curer): # percent to completion
cur += "|"
for i in range(100-int(curer)): # Distance from completion
cur += "."
cur2 = str(cur) + "] " + str(curer) + "% Complete"
print("Cure Completion")
print(cur2)
print("\n")
time.sleep(1)
def color_cur_graph(): #Displays the percent of cure completion
with open("UniData.txt", 'r') as f:
variables = json.load(f)
cur = "["
curer = int(variables["cure_percent"])
for i in range(curer): # percent to completion
cur += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
for i in range(100-int(curer)): # Distance from completion
cur += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
cur2 = str(cur) + "] " + str(curer) + "% Complete"
print("Cure Completion")
print(cur2)
print("\n")
time.sleep(1)
def cur_graph_mini():
with open("UniData.txt", 'r') as f:
variables = json.load(f)
cur = "["
cur_t = 0
variables["cure_percent"] = (float(variables["cure"]) / 1000) * 100
curer = int(variables["cure_percent"] / 10)
for i in range(curer): # percent to completion
cur += "|"
cur_t += 10
for i in range(10 - int(curer)): # Distance from completion
cur += "."
cur2 = str(cur) + "] " + str(cur_t) + "% Cure"
print(cur2)
def color_cur_graph_mini():
with open("UniData.txt", 'r') as f:
variables = json.load(f)
cur = "["
cur_t = 0
variables["cure_percent"] = (float(variables["cure"]) / 1000) * 100
curer = int(cure_percent / 10)
for i in range(curer): # percent to completion
cur += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
cur_t += 10
for i in range(10 - int(curer)): # Distance from completion
cur += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
cur2 = str(cur) + "] " + str(cur_t) + "% Cure"
print(cur2)
def hea_graph(): # A graph for the amount of variables["healthy"] people
with open("UniData.txt", 'r') as f:
variables = json.load(f)
hea = "["
alive2 = (float(variables["healthy"])/variables["limit"])
if alive2 > .99: #Quick fix for the "less than 100%" Bug
alive2 = 1
alive3 = int(alive2 * 100)
for i in range(alive3): # Amount variables["healthy"]
hea += "|"
for i in range(100 - int(alive3)): # Amount not variables["healthy"]
hea += "."
cur2 = str(hea) + "] " + str(alive3) + "% Healthy"
print("Healthy People")
print(cur2)
print("\n")
WordCore.word_corex("Healthy |", str(variables["healthy"]) + " People Healthy")
print("\n")
time.sleep(1)
def color_hea_graph(): # A graph for the amount of variables["healthy"] people
with open("UniData.txt", 'r') as f:
variables = json.load(f)
hea = "["
alive2 = (float(variables["healthy"])/variables["limit"])
if alive2 > .99: #Quick fix for the "less than 100%" Bug
alive2 = 1
alive3 = int(alive2 * 100)
for i in range(alive3): # Amount variables["healthy"]
hea += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
for i in range(100 - int(alive3)): # Amount not variables["healthy"]
hea += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
cur2 = str(hea) + "] " + str(alive3) + "% Healthy"
print("Healthy People")
print(cur2)
print("\n")
WordCore.word_corex("Healthy |", str(variables["healthy"]) + " People Healthy")
print("\n")
time.sleep(1)
def hea_graph_mini():
with open("UniData.txt", 'r') as f:
variables = json.load(f)
hea = "["
hea_t = 0
alive2 = (float(variables["healthy"])/variables["limit"])
if alive2 > .99: #Quick fix for the "less than 100%" Bug
alive2 = 1
alive3 = int(alive2 * 10)
for i in range(alive3): # Amount variables["healthy"]
hea += "|"
hea_t += 10
for i in range(10 - int(alive3)): # Amount not variables["healthy"]
hea += "."
cur2 = str(hea) + "] " + str(hea_t) + "% Healthy"
print(cur2)
def color_hea_graph_mini():
with open("UniData.txt", 'r') as f:
variables = json.load(f)
hea = "["
hea_t = 0
alive2 = (float(variables["healthy"])/variables["limit"])
if alive2 > .99: #Quick fix for the "less than 100%" Bug
alive2 = 1
alive3 = int(alive2 * 10)
for i in range(alive3): # Amount variables["healthy"]
hea += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
hea_t += 10
for i in range(10 - int(alive3)): # Amount not variables["healthy"]
hea += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
cur2 = str(hea) + "] " + str(hea_t) + "% Healthy"
print(cur2)
def dea_graph():
with open("UniData.txt", 'r') as f:
variables = json.load(f)
corpse = int((float(variables["dead"]) / variables["limit"]) * 100)
dea = "["
for i in range(corpse): # Amount variables["dead"]
dea += "|"
for i in range(100 - int(corpse)): # Amount not variables["dead"]
dea += "."
dea2 = str(dea) + "] " + str(corpse) + "% Dead"
print("Population Dead")
print(dea2)
print("\n")
WordCore.word_corex("Dead |", str(variables["dead"]) + " People Dead")
print("\n")
time.sleep(1)
def color_dea_graph():
with open("UniData.txt", 'r') as f:
variables = json.load(f)
corpse = int((float(variables["dead"]) / variables["limit"]) * 100)
dea = "["
for i in range(corpse): # Amount variables["dead"]
dea += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
for i in range(100 - int(corpse)): # Amount not variables["dead"]
dea += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
dea2 = str(dea) + "] " + str(corpse) + "% Dead"
print("Population Dead")
print(dea2)
print("\n")
WordCore.word_corex("Dead |", str(variables["dead"]) + " People Dead")
print("\n")
time.sleep(1)
def dea_graph_mini():
with open("UniData.txt", 'r') as f:
variables = json.load(f)
corpse = int((float(variables["dead"]) / variables["limit"]) * 10)
dea = "["
dea_t = 0
for i in range(corpse): # Amount variables["dead"]
dea += "|"
dea += 10
for i in range(10 - int(corpse)): # Amount not variables["dead"]
dea += "."
dea2 = str(dea) + "] " + str(dea_t) + "% Dead"
print(dea2)
def color_dea_graph_mini():
with open("UniData.txt", 'r') as f:
variables = json.load(f)
corpse = int((float(variables["dead"]) / variables["limit"]) * 10)
dea = "["
dea_t = 0
for i in range(corpse): # Amount variables["dead"]
dea += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
dea += 10
for i in range(10 - int(corpse)): # Amount not variables["dead"]
dea += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
dea2 = str(dea) + "] " + str(dea_t) + "% Dead"
print(dea2)
def zom_graph(): # Graph of variables["variables["zombies"]"]
with open("UniData.txt", 'r') as f:
variables = json.load(f)
walkers = int((float(variables["zombies"]) / variables["limit"]) * 100)
zom = "["
for i in range(walkers): # Are zombs
zom += "|"
for i in range(100 - int(walkers)): # Are not zombs
zom += "."
zom2 = str(zom) + "] " + str(walkers) + "% Zombies"
print("Population Zombified")
print(zom2)
print("\n")
WordCore.word_corex("Zombies |", str(variables["zombies"]) + " People Zombified")
print("\n")
time.sleep(1)
def color_zom_graph(): # Graph of variables["zombies"]
with open("UniData.txt", 'r') as f:
variables = json.load(f)
walkers = int((float(variables["zombies"]) / variables["limit"]) * 100)
zom = "["
for i in range(walkers): # Are zombs
zom += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
for i in range(100 - int(walkers)): # Are not zombs
zom += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
zom2 = str(zom) + "] " + str(walkers) + "% Zombies"
print("Population Zombified")
print(zom2)
print("\n")
WordCore.word_corex("Zombies |", str(variables["zombies"]) + " People Zombified")
print("\n")
time.sleep(1)
def zom_graph_mini(): # Graph of variables["zombies"]
with open("UniData.txt", 'r') as f:
variables = json.load(f)
walkers = int((float(variables["zombies"]) / variables["limit"]) * 10)
zom = "["
zom_t = 0
for i in range(walkers): # Are zombs
zom += "|"
zom_t += 10
for i in range(10 - int(walkers)): # Are not zombs
zom += "."
zom2 = str(zom) + "] " + str(zom_t) + "% Zombies"
print(zom2)
def color_zom_graph_mini(): # Graph of variables["zombies"]
with open("UniData.txt", 'r') as f:
variables = json.load(f)
walkers = int((float(variables["zombies"]) / variables["limit"]) * 10)
zom = "["
zom_t = 0
for i in range(walkers): # Are zombs
zom += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
zom_t += 10
for i in range(10 - int(walkers)): # Are not zombs
zom += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
zom2 = str(zom) + "] " + str(zom_t) + "% Zombies"
print(zom2)
def graphical_analysis(): # Displays all world graphs
inf_graph()
hea_graph()
dea_graph()
zom_graph()
cure_progress()
print("\n")
input(str("Press ENTER to continue..."))
def color_graphical_analysis(): # Displays all world graphs
color_inf_graph()
color_hea_graph()
color_dea_graph()
color_zom_graph()
color_cure_progress()
print("\n")
input(str("Press ENTER to continue..."))
def graphical_analysis_mini():
with open("UniData.txt", 'r') as f:
variables = json.load(f)
inf_graph_mini()
hea_graph_mini()
dea_graph_mini()
cur_graph_mini()
plague_status_graph_mini()
def color_plague_status_graph(): # Displays all plague graphs
with open("UniData.txt", 'r') as f:
variables = json.load(f)
tiv = "["
sev = "["
let = "["
status = int((float(variables["infectivity"]) / variables["infectivity_limit"]) * 100)
for i in range(status):
tiv += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
for i in range(100-int(status)):
tiv += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
status2 = int((float(variables["severity"]) / variables["severity_limit"]) * 100)
for i in range(status2):
sev += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
for i in range(100-int(status2)):
sev += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
status3 = int((float(variables["lethality"]) / variables["lethality_limit"]) * 100)
for i in range(status3):
let += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
for i in range(100-int(status3)):
let += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
infective = str(tiv) + "] " + str(status) + "% To Infectivity Max"
severe = str(sev) + "] " + str(status2) + "% To Severity Max"
lethal = str(let) + "] " + str(status3) + "% To Lethality Max"
print("Infectivity Level")
print(infective)
print("\n")
time.sleep(1)
print("Severity Level")
print(severe)
print("\n")
time.sleep(1)
print("Lethality Level")
print(lethal)
print("\n")
time.sleep(1)
input(str("Press ENTER to continue..."))
def plague_status_graph(): # Displays all plague graphs
with open("UniData.txt", 'r') as f:
variables = json.load(f)
tiv = "["
sev = "["
let = "["
status = int((float(variables["infectivity"]) / variables["infectivity_limit"]) * 100)
for i in range(status):
tiv += "|"
for i in range(100-int(status)):
tiv += "."
status2 = int((float(variables["severity"]) / variables["severity_limit"]) * 100)
for i in range(status2):
sev += "|"
for i in range(100-int(status2)):
sev += "."
status3 = int((float(variables["lethality"]) / variables["lethality_limit"]) * 100)
for i in range(status3):
let += "|"
for i in range(100-int(status3)):
let += "."
infective = str(tiv) + "] " + str(status) + "% To Infectivity Max"
severe = str(sev) + "] " + str(status2) + "% To Severity Max"
lethal = str(let) + "] " + str(status3) + "% To Lethality Max"
print("Infectivity Level")
print(infective)
print("\n")
time.sleep(1)
print("Severity Level")
print(severe)
print("\n")
time.sleep(1)
print("Lethality Level")
print(lethal)
print("\n")
time.sleep(1)
input(str("Press ENTER to continue..."))
def plague_status_graph_mini(): # Displays all plague graphs
with open("UniData.txt", 'r') as f:
variables = json.load(f)
tiv = "["
tiv_t = 0
sev = "["
sev_t = 0
let = "["
let_t = 0
status = int((float(variables["infectivity"]) / variables["infectivity_limit"]) * 10)
for i in range(status):
tiv += "|"
tiv_t += 10
for i in range(10-int(status)):
tiv += "."
status2 = int((float(variables["severity"]) / variables["severity_limit"]) * 10)
for i in range(status2):
sev += "|"
sev += 10
for i in range(10-int(status2)):
sev += "."
status3 = int((float(variables["lethality"]) / variables["lethality_limit"]) * 10)
for i in range(status3):
let += "|"
let_t += 10
for i in range(10-int(status3)):
let += "."
infective = str(tiv) + "] " + str(tiv_t) + "% To Infectivity Max"
severe = str(sev) + "] " + str(sev_t) + "% To Severity Max"
lethal = str(let) + "] " + str(let_t) + "% To Lethality Max"
print(infective)
print(severe)
print(lethal)
time.sleep(1)
input(str("Press ENTER to continue..."))
def color_plague_status_graph_mini(): # Displays all plague graphs
with open("UniData.txt", 'r') as f:
variables = json.load(f)
tiv = "["
tiv_t = 0
sev = "["
sev_t = 0
let = "["
let_t = 0
status = int((float(variables["infectivity"]) / variables["infectivity_limit"]) * 10)
for i in range(status):
tiv += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
tiv_t += 10
for i in range(10-int(status)):
tiv += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
status2 = int((float(variables["severity"]) / variables["severity_limit"]) * 10)
for i in range(status2):
sev += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
sev += 10
for i in range(10-int(status2)):
sev += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
status3 = int((float(variables["lethality"]) / variables["lethality_limit"]) * 10)
for i in range(status3):
let += ColorSplash.Green_Squarexx + "|" + ColorSplash.Reset
let_t += 10
for i in range(10-int(status3)):
let += ColorSplash.Red_Squarexxxx + "." + ColorSplash.Reset
infective = str(tiv) + "] " + str(tiv_t) + "% To Infectivity Max"
severe = str(sev) + "] " + str(sev_t) + "% To Severity Max"
lethal = str(let) + "] " + str(let_t) + "% To Lethality Max"
print(infective)
print(severe)
print(lethal)
time.sleep(1)
input(str("Press ENTER to continue..."))
#color_plague_status_graph()