-
Notifications
You must be signed in to change notification settings - Fork 0
/
TheMathAge_ana.py
587 lines (496 loc) · 29.8 KB
/
TheMathAge_ana.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
'''
Created on 20. feb. 2017
@author: mrmossevig
License: CC-BY
'''
import copy
import math
import heapq
import argparse
def main():
# Parsing arguments
parser = argparse.ArgumentParser()
parser.add_argument("-v", "--verbose", action="store_true")
parser.add_argument("-d", "--sides", default=6)
args = parser.parse_args()
verbose = args.verbose
sides = int(args.sides)
print("Verbose(-v): %d" % verbose)
print("Sides (-d): %d" % sides)
# Creating and printing diethrow tables
createTables(sides)
printTables(verbose)
def find_triples(array):
ordered = [0, 0, 0, 0, 0, 0, 0]
for number in array:
ordered[number] += 1
if(max(ordered) >= 3):
return True
else:
return False
def sum_prob(array):
sum_p = 0
sum_f = 0
avg = 0
for entry in array:
sum_p += entry[1]
sum_f += entry[2]
avg += entry[0]*entry[1]
entry[3] = sum_p
array[0][4] = avg
array[1][4] = sum_p
array[2][4] = sum_f
def print_prob(array):
for entry in array:
statcurve = ''
for p in range(1, round(entry[1]*100)):
statcurve += 'X'
if (entry[2] != 0):
print("%d\t%d\t%.4f\t%.4f\t%s" % (entry[0], entry[2], entry[1], entry[3], statcurve))
print("SUM:\t%d\t%.4f" % (array[2][4], array[1][4]))
print("AVG:\t%f" % array[0][4])
def createTables(sides):
### Creating diethrow arrays ###
# Normal die rolls
global onedie
global twodice
global threedice
global fourdice
global fivedice
global sixdice
# Reroll ones
global od_rerollone
global twd_rerollone
global thd_rerollone
# Drop low/high
global thd_droplow
global thd_drophigh
global fod_droplow
global fod_droptwolow
# Reroll, take highest
global twd_rr
global thd_dl_rr
global fod_dtl_rr
# Reroll ones + drop low
global thd_rro_dl
# Drop low, add d3 (SS + Daring)
global thd_dl_d3
# Magic throws
global twd_opchance
global thd_opchance
global fod_opchance
global fid_opchance
### Filling diethrow arrays with 0s ###
diearray = [[0,0,0,0,0]] # Result, prob, frequency, cumsum_prop, extra (AVG, Op-chance)
for i in range(1,37):
diearray.append([0,0,0,0,0]);
diearray[i][0] = i
# Normal die rolls
onedie = copy.deepcopy(diearray)
twodice = copy.deepcopy(diearray)
threedice = copy.deepcopy(diearray)
fourdice = copy.deepcopy(diearray)
fivedice = copy.deepcopy(diearray)
sixdice = copy.deepcopy(diearray)
sevendice = copy.deepcopy(diearray)
eightdice = copy.deepcopy(diearray)
# Reroll ones
od_rerollone = copy.deepcopy(diearray)
twd_rerollone = copy.deepcopy(diearray)
thd_rerollone = copy.deepcopy(diearray)
# Drop low/high
thd_droplow = copy.deepcopy(diearray)
thd_drophigh = copy.deepcopy(diearray)
fod_droplow = copy.deepcopy(diearray)
fod_droptwolow = copy.deepcopy(diearray)
# Reroll, take highest
twd_rr = copy.deepcopy(diearray)
thd_dl_rr = copy.deepcopy(diearray)
fod_dtl_rr = copy.deepcopy(diearray)
# Reroll ones + drop low
thd_rro_dl = copy.deepcopy(diearray)
# Drop low, add d3 (SS + Daring)
thd_dl_d3 = copy.deepcopy(diearray)
# Magic throws
twd_opchance = copy.deepcopy(diearray)
thd_opchance = copy.deepcopy(diearray)
fod_opchance = copy.deepcopy(diearray)
fid_opchance = copy.deepcopy(diearray)
prob = 1/sides
### Populating diethrow arrays ###
# First die
for die1 in range(1,sides+1):
result1 = die1
prob1 = prob
onedie[result1][1] += prob1
onedie[result1][2] += 1
# Second die
for die2 in range(1,sides+1):
result2 = result1 + die2
prob2 = prob1 * prob
twodice[result2][1] += prob2
twodice[result2][2] += 1
# Adding probs for 1D6 with reroll one
if(die1 == 1):
od_rerollone[die2][1] += prob2
od_rerollone[die2][2] += 1
else:
od_rerollone[die1][1] += prob2
od_rerollone[die1][2] += 1
# Third die
for die3 in range(1,sides+1):
result3 = result2 + die3
prob3 = prob2 * prob
threedice[result3][1] += prob3
threedice[result3][2] += 1
# Add result to drop-low (Swiftstride)
result_dl = result3 - min(die1, die2, die3)
thd_droplow[result_dl][1] += prob3
thd_droplow[result_dl][2] += 1
# Add result to drop-high (cold-blooded Ld)
result_dh = result3 - max(die1, die2, die3)
thd_drophigh[result_dh][1] += prob3
thd_drophigh[result_dh][2] += 1
# Add result to magic die throw with three dice
if ((die1 == die2 ) and (die2 == die3)):
thd_opchance[4][4] += prob3
# Fourth die
for die4 in range(1,sides+1):
result4 = result3 + die4
prob4 = prob3 * prob
fourdice[result4][1] += prob4
fourdice[result4][2] += 1
# Add result to Drop low, add d3 (SS + Daring)
if die4 in range (1,4):
thd_dl_d3[result_dl + die4][1] += prob3*(1/3)
thd_dl_d3[result_dl + die4][2] += 1
# Add percentage to op-chance if we have three of a kind
if (find_triples([die1, die2, die3, die4])):
fod_opchance[4][4] += prob4
# Adding probs for 2D6 with reroll one
if ((die1 == 1) and (die2 == 1)):
twd_rerollone[die3+die4][1] += prob4
twd_rerollone[die3+die4][2] += 1
elif (die1 == 1):
twd_rerollone[die2+die3][1] += prob4
twd_rerollone[die2+die3][2] += 1
elif (die2 == 1):
twd_rerollone[die1+die3][1] += prob4
twd_rerollone[die1+die3][2] += 1
else:
twd_rerollone[die1+die2][1] += prob4
twd_rerollone[die1+die2][2] += 1
# Result for charge+RR - only used for average charge length
result_rr1 = die1 + die2
result_rr2 = die3 + die4
result_rr = max(result_rr1, result_rr2)
twd_rr[result_rr][1] += prob4
twd_rr[result_rr][2] += 1
# Add result to drop-low (Swiftstride)
result_dl4 = result4 - min(die1, die2, die3, die4)
fod_droplow[result_dl4][1] += prob4
fod_droplow[result_dl4][2] += 1
# Add result to drop two low (SS + Daring 2.0)
diearray = [die1, die2, die3, die4]
diearray.remove(min(diearray))
diearray.remove(min(diearray))
result_d2l4 = sum(diearray)
fod_droptwolow[result_d2l4][1] += prob4
fod_droptwolow[result_d2l4][2] += 1
# Fifth die
for die5 in range(1,sides+1):
result5 = result4 + die5
prob5 = prob4 * prob
fivedice[result5][1] += prob5
fivedice[result5][2] += 1
# Add percentage to op-chance if we have three of a kind
if (find_triples([die1, die2, die3, die4, die5])):
fid_opchance[4][4] += prob5
# Sixth die
for die6 in range(1,sides+1):
result6 = result5 + die6
prob6 = prob5 * prob
sixdice[result6][1] += prob6
sixdice[result6][2] += 1
# Adding probs for 2D6 with reroll one
if ((die1 == 1) and (die2 == 1) and (die3 == 1)):
dice_used = [die4, die5, die6]
elif ((die1 == 1) and (die2 == 1)):
dice_used = [die3 ,die4, die5]
elif ((die1 == 1) and (die3 == 1)):
dice_used = [die2, die4, die5]
elif ((die2 == 1) and (die3 == 1)):
dice_used = [die1, die4, die5]
elif (die1 == 1):
dice_used = [die2, die3, die4]
elif (die2 == 1):
dice_used = [die1, die3, die4]
elif (die3 == 1):
dice_used = [die1, die2, die4]
else:
dice_used = [die1, die2, die3]
sum_faces = sum(dice_used)
thd_rerollone[sum_faces][1] += prob6
thd_rerollone[sum_faces][2] += 1
thd_rro_dl[sum_faces - min(dice_used)][1] += prob6
thd_rro_dl[sum_faces - min(dice_used)][2] += 1
# Result for Swiftstride+reroll (drop low, reroll, take highest) - only used for average charge length
result_dl1 = die1 + die2 + die3 - min(die1, die2, die3)
result_dl2 = die4 + die5 + die6 - min(die4, die5, die6)
result_dl_rr = max(result_dl1, result_dl2)
thd_dl_rr[result_dl_rr][1] += prob6
thd_dl_rr[result_dl_rr][2] += 1
# Seventh die
for die7 in range(1,sides+1):
result7 = result6 + die7
prob7 = prob6 * prob
# Does not need this
# sevendice[result7][1] += prob7
# sevendice[result7][2] += 1
# Sixth die
for die8 in range(1,sides+1):
result8 = result7 + die8
prob8 = prob7 * prob
# Does not need this
# eightdice[result8][1] += prob7
# eightdice[result8][2] += 1
# Add result to drop two low (SS + Daring 2.0 + reroll)
diearray = [die1, die2, die3, die4]
diearray.remove(min(diearray))
diearray.remove(min(diearray))
result_d2l4 = sum(diearray)
diearray2 = [die5, die6, die7, die8]
diearray2.remove(min(diearray2))
diearray2.remove(min(diearray2))
result_d2l42 = sum(diearray2)
result_d2l4 = max(result_d2l4, result_d2l42)
fod_dtl_rr[result_d2l4][1] += prob8
fod_dtl_rr[result_d2l4][2] += 1
# Summing up probs
sum_prob(onedie)
sum_prob(twodice)
sum_prob(threedice)
sum_prob(fourdice)
sum_prob(fivedice)
sum_prob(sixdice)
sum_prob(sevendice)
sum_prob(eightdice)
# Drop high/low
sum_prob(thd_droplow)
sum_prob(thd_drophigh)
sum_prob(fod_droplow)
sum_prob(fod_droptwolow)
# Reroll all
sum_prob(twd_rr)
sum_prob(thd_dl_rr)
sum_prob(fod_dtl_rr)
# Reroll ones
sum_prob(od_rerollone)
sum_prob(twd_rerollone)
sum_prob(thd_rerollone)
sum_prob(thd_rro_dl)
# Drop low, add d3
sum_prob(thd_dl_d3)
# Magic dice
sum_prob(twd_opchance)
sum_prob(thd_opchance)
sum_prob(fod_opchance)
sum_prob(fid_opchance)
def printTables(verbose):
if (verbose == 1):
print("\n1D6:")
print_prob(onedie)
print("\n2D6:")
print_prob(twodice)
print("\n3D6:")
print_prob(threedice)
print("\n4D6:")
print_prob(fourdice)
print("\n5D6:")
print_prob(fivedice)
print("\n6D6:")
print_prob(sixdice)
print("\n3D6 drop low:")
print_prob(thd_droplow)
print("\n3D6 drop high:")
print_prob(thd_drophigh)
print("\n4D6 drop low:")
print_prob(fod_droplow)
print("\n4D6 drop two low:")
print_prob(fod_droptwolow)
print("\n2D6, reroll, take highest:")
print_prob(twd_rr)
print("\n3D6 drop low, reroll, take highest:")
print_prob(thd_dl_rr)
print("\n4D6 drop two low, reroll, take highest:")
print_prob(fod_dtl_rr)
print("\n1D6 reroll ones:")
print_prob(od_rerollone)
print("\n2D6 reroll ones:")
print_prob(twd_rerollone)
print("\n3D6 reroll ones:")
print_prob(thd_rerollone)
print("\n3D6 reroll ones, drop lowest:")
print_prob(thd_rro_dl)
print("\n3D6, drop lowest, add d3")
print_prob(thd_dl_d3)
# print("\n2D6 with OP-chance:")
# print_prob(twd_opchance)
#
# print("\n3D6 with OP-chance:")
# print_prob(thd_opchance)
#
# print("\n4D6 with OP-chance:")
# print_prob(fod_opchance)
#
# print("\n5D6 with OP-chance:")
# print_prob(fid_opchance)
print("\nLeaderhip\t2\t3\t4\t5\t6\t7\t8\t9\t10")
print("Normal\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%" %
(100*(twodice[2][3]), 100*(twodice[3][3]), 100*(twodice[4][3]), 100*(twodice[5][3]), 100*(twodice[6][3]),
100*(twodice[7][3]), 100*(twodice[8][3]), 100*(twodice[9][3]), 100*(twodice[10][3])))
print("Reroll\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%" %
(100*(1-(1-twodice[2][3])**2), 100*(1-(1-twodice[3][3])**2), 100*(1-(1-twodice[4][3])**2), 100*(1-(1-twodice[5][3])**2), 100*(1-(1-twodice[6][3])**2),
100*(1-(1-twodice[7][3])**2), 100*(1-(1-twodice[8][3])**2), 100*(1-(1-twodice[9][3])**2), 100*(1-(1-twodice[10][3])**2)))
print("Cold-blooded\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%" %
(100*(thd_drophigh[2][3]), 100*(thd_drophigh[3][3]), 100*(thd_drophigh[4][3]), 100*(thd_drophigh[5][3]), 100*(thd_drophigh[6][3]),
100*(thd_drophigh[7][3]), 100*(thd_drophigh[8][3]), 100*(thd_drophigh[9][3]), 100*(thd_drophigh[10][3])))
print("CB+Reroll\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%" %
(100*(1-(1-thd_drophigh[2][3])**2), 100*(1-(1-thd_drophigh[3][3])**2), 100*(1-(1-thd_drophigh[4][3])**2), 100*(1-(1-thd_drophigh[5][3])**2), 100*(1-(1-thd_drophigh[6][3])**2),
100*(1-(1-thd_drophigh[7][3])**2), 100*(1-(1-thd_drophigh[8][3])**2), 100*(1-(1-thd_drophigh[9][3])**2), 100*(1-(1-thd_drophigh[10][3])**2)))
print("\nCharge Range\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t\tAVG")
print("Charge\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
(100,
100*(1-twodice[2][3]), 100*(1-twodice[3][3]), 100*(1-twodice[4][3]), 100*(1-twodice[5][3]), 100*(1-twodice[6][3]),
100*(1-twodice[7][3]), 100*(1-twodice[8][3]), 100*(1-twodice[9][3]), 100*(1-twodice[10][3]), 100*(1-twodice[11][3]),
twodice[0][4]))
# Equivalent to the one below
#print("Charge+Reroll\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
# (100,
# 100*(1-twodice[2][3]**2), 100*(1-twodice[3][3]**2), 100*(1-twodice[4][3]**2), 100*(1-twodice[5][3]**2), 100*(1-twodice[6][3]**2),
# 100*(1-twodice[7][3]**2), 100*(1-twodice[8][3]**2), 100*(1-twodice[9][3]**2), 100*(1-twodice[10][3]**2), 100*(1-twodice[11][3]**2),
# twd_rr[0][4]))
print("Charge+Reroll\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
(100,
100*(1-twd_rr[2][3]), 100*(1-twd_rr[3][3]), 100*(1-twd_rr[4][3]), 100*(1-twd_rr[5][3]), 100*(1-twd_rr[6][3]),
100*(1-twd_rr[7][3]), 100*(1-twd_rr[8][3]), 100*(1-twd_rr[9][3]), 100*(1-twd_rr[10][3]), 100*(1-twd_rr[11][3]),
twd_rr[0][4]))
print("Swiftstride\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
(100,
100*(1-thd_droplow[2][3]), 100*(1-thd_droplow[3][3]), 100*(1-thd_droplow[4][3]), 100*(1-thd_droplow[5][3]), 100*(1-thd_droplow[6][3]),
100*(1-thd_droplow[7][3]), 100*(1-thd_droplow[8][3]), 100*(1-thd_droplow[9][3]), 100*(1-thd_droplow[10][3]), 100*(1-thd_droplow[11][3]),
thd_droplow[0][4]))
print("SS+BotS\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
(100,
100*(1-thd_rro_dl[2][3]), 100*(1-thd_rro_dl[3][3]), 100*(1-thd_rro_dl[4][3]), 100*(1-thd_rro_dl[5][3]), 100*(1-thd_rro_dl[6][3]),
100*(1-thd_rro_dl[7][3]), 100*(1-thd_rro_dl[8][3]), 100*(1-thd_rro_dl[9][3]), 100*(1-thd_rro_dl[10][3]), 100*(1-thd_rro_dl[11][3]),
thd_rro_dl[0][4]))
# Equivalent to the one below
#print("SS+Reroll\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
# (100,
# 100*(1-thd_droplow[2][3]**2), 100*(1-thd_droplow[3][3]**2), 100*(1-thd_droplow[4][3]**2), 100*(1-thd_droplow[5][3]**2), 100*(1-thd_droplow[6][3]**2),
# 100*(1-thd_droplow[7][3]**2), 100*(1-thd_droplow[8][3]**2), 100*(1-thd_droplow[9][3]**2), 100*(1-thd_droplow[10][3]**2), 100*(1-thd_droplow[11][3]**2),
# thd_dl_rr[0][4]))
print("SS+Reroll\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
(100,
100*(1-thd_dl_rr[2][3]), 100*(1-thd_dl_rr[3][3]), 100*(1-thd_dl_rr[4][3]), 100*(1-thd_dl_rr[5][3]), 100*(1-thd_dl_rr[6][3]),
100*(1-thd_dl_rr[7][3]), 100*(1-thd_dl_rr[8][3]), 100*(1-thd_dl_rr[9][3]), 100*(1-thd_dl_rr[10][3]), 100*(1-thd_dl_rr[11][3]),
thd_dl_rr[0][4]))
# print("SS+Daring1.3\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
# (100,
# 100*(1-thd_dl_d3[2][3]), 100*(1-thd_dl_d3[3][3]), 100*(1-thd_dl_d3[4][3]), 100*(1-thd_dl_d3[5][3]), 100*(1-thd_dl_d3[6][3]),
# 100*(1-thd_dl_d3[7][3]), 100*(1-thd_dl_d3[8][3]), 100*(1-thd_dl_d3[9][3]), 100*(1-thd_dl_d3[10][3]), 100*(1-thd_dl_d3[11][3]),
# thd_dl_d3[0][4]))
print("SS+Daring\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
(100,
100*(1-fod_droptwolow[2][3]), 100*(1-fod_droptwolow[3][3]), 100*(1-fod_droptwolow[4][3]), 100*(1-fod_droptwolow[5][3]), 100*(1-fod_droptwolow[6][3]),
100*(1-fod_droptwolow[7][3]), 100*(1-fod_droptwolow[8][3]), 100*(1-fod_droptwolow[9][3]), 100*(1-fod_droptwolow[10][3]), 100*(1-fod_droptwolow[11][3]),
fod_droptwolow[0][4]))
print("SS+RR+Daring\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
(100,
100*(1-fod_dtl_rr[2][3]), 100*(1-fod_dtl_rr[3][3]), 100*(1-fod_dtl_rr[4][3]), 100*(1-fod_dtl_rr[5][3]), 100*(1-fod_dtl_rr[6][3]),
100*(1-fod_dtl_rr[7][3]), 100*(1-fod_dtl_rr[8][3]), 100*(1-fod_dtl_rr[9][3]), 100*(1-fod_dtl_rr[10][3]), 100*(1-fod_dtl_rr[11][3]),
fod_dtl_rr[0][4]))
# print("SS+ToT\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
# (100,
# 100*(1-fod_droplow[2][3]), 100*(1-fod_droplow[3][3]), 100*(1-fod_droplow[4][3]), 100*(1-fod_droplow[5][3]), 100*(1-fod_droplow[6][3]),
# 100*(1-fod_droplow[7][3]), 100*(1-fod_droplow[8][3]), 100*(1-fod_droplow[9][3]), 100*(1-fod_droplow[10][3]), 100*(1-fod_droplow[11][3]),
# fod_droplow[0][4]))
#print("SS+BotS+RR\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f" %
# (100,
# 100*(1-thd_rro_dl[2][3]**2), 100*(1-thd_rro_dl[3][3]**2), 100*(1-thd_rro_dl[4][3]**2), 100*(1-thd_rro_dl[5][3]**2), 100*(1-thd_rro_dl[6][3]**2),
# 100*(1-thd_rro_dl[7][3]**2), 100*(1-thd_rro_dl[8][3]**2), 100*(1-thd_rro_dl[9][3]**2), 100*(1-thd_rro_dl[10][3]**2), 100*(1-thd_rro_dl[11][3]**2),
# thd_rro_dl[0][4]))
# print("\nExtra die available:")
# print("Cast/Dispel\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t\tAVG\tOP")
# print("1D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f\t%.1f%%" %
# (0, 100*(1-onedie[2][3]), 100*(1-onedie[3][3]), 100*(1-onedie[4][3]), 100*(1-onedie[5][3]), 100*(1-onedie[6][3]),
# 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
# onedie[0][4], 0))
# print("2D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f\t%.1f%%" %
# (100*(1-twd_opchance[1][3]), 100*(1-twd_opchance[2][3]), 100*(1-twd_opchance[3][3]), 100*(1-twd_opchance[4][3]), 100*(1-twd_opchance[5][3]), 100*(1-twd_opchance[6][3] ),
# 100*(1-twd_opchance[7][3]), 100*(1-twd_opchance[8][3]), 100*(1-twd_opchance[9][3]), 100*(1-twd_opchance[10][3]), 100*(1-twd_opchance[11][3]), 100*(1-twd_opchance[12][3]),
# 100*(1-twd_opchance[13][3]), 100*(1-twd_opchance[14][3]), 100*(1-twd_opchance[15][3]), 100*(1-twd_opchance[16][3]), 100*(1-twd_opchance[17][3]), 100*(1-twd_opchance[18][3]),
# twd_opchance[0][4], 100*twd_opchance[4][4]))
# print("3D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f\t%.1f%%" %
# (100*(1-thd_opchance[1][3]), 100*(1-thd_opchance[2][3]), 100*(1-thd_opchance[3][3]), 100*(1-thd_opchance[4][3]), 100*(1-thd_opchance[5][3]), 100*(1-thd_opchance[6][3] ),
# 100*(1-thd_opchance[7][3]), 100*(1-thd_opchance[8][3]), 100*(1-thd_opchance[9][3]), 100*(1-thd_opchance[10][3]), 100*(1-thd_opchance[11][3]), 100*(1-thd_opchance[12][3]),
# 100*(1-thd_opchance[13][3]), 100*(1-thd_opchance[14][3]), 100*(1-thd_opchance[15][3]), 100*(1-thd_opchance[16][3]), 100*(1-thd_opchance[17][3]), 100*(1-thd_opchance[18][3]),
# thd_opchance[0][4], 100*thd_opchance[4][4]))
# print("4D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f\t%.1f%%" %
# (100*(1-fod_opchance[1][3]), 100*(1-fod_opchance[2][3]), 100*(1-fod_opchance[3][3]), 100*(1-fod_opchance[4][3]), 100*(1-fod_opchance[5][3]), 100*(1-fod_opchance[6][3] ),
# 100*(1-fod_opchance[7][3]), 100*(1-fod_opchance[8][3]), 100*(1-fod_opchance[9][3]), 100*(1-fod_opchance[10][3]), 100*(1-fod_opchance[11][3]), 100*(1-fod_opchance[12][3]),
# 100*(1-fod_opchance[13][3]), 100*(1-fod_opchance[14][3]), 100*(1-fod_opchance[15][3]), 100*(1-fod_opchance[16][3]), 100*(1-fod_opchance[17][3]), 100*(1-fod_opchance[18][3]),
# fod_opchance[0][4], 100*fod_opchance[4][4]))
# print("5D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f\t%.1f%%" %
# (100*(1-fid_opchance[1][3]), 100*(1-fid_opchance[2][3]), 100*(1-fid_opchance[3][3]), 100*(1-fid_opchance[4][3]), 100*(1-fid_opchance[5][3]), 100*(1-fid_opchance[6][3] ),
# 100*(1-fid_opchance[7][3]), 100*(1-fid_opchance[8][3]), 100*(1-fid_opchance[9][3]), 100*(1-fid_opchance[10][3]), 100*(1-fid_opchance[11][3]), 100*(1-fid_opchance[12][3]),
# 100*(1-fid_opchance[13][3]), 100*(1-fid_opchance[14][3]), 100*(1-fid_opchance[15][3]), 100*(1-fid_opchance[16][3]), 100*(1-fid_opchance[17][3]), 100*(1-fid_opchance[18][3]),
# fid_opchance[0][4], 100*fid_opchance[4][4]))
# print("\nNo extra die available:")
print("\nCast/Dispel\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t\tAVG\tOP")
print("1D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f\t%.1f%%" %
(0, 100*(1-onedie[2][3]), 100*(1-onedie[3][3]), 100*(1-onedie[4][3]), 100*(1-onedie[5][3]), 100*(1-onedie[6][3]),
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
onedie[0][4], 0))
print("2D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f\t%.1f%%" %
(100*(1-twodice[1][3]), 100*(1-twodice[2][3]), 100*(1-twodice[3][3]), 100*(1-twodice[4][3]), 100*(1-twodice[5][3]), 100*(1-twodice[6][3] ),
100*(1-twodice[7][3]), 100*(1-twodice[8][3]), 100*(1-twodice[9][3]), 100*(1-twodice[10][3]), 100*(1-twodice[11][3]), 100*(1-twodice[12][3]),
100*(1-twodice[13][3]), 100*(1-twodice[14][3]), 100*(1-twodice[15][3]), 100*(1-twodice[16][3]), 100*(1-twodice[17][3]), 100*(1-twodice[18][3]),
twodice[0][4], 100*twd_opchance[4][4]))
print("3D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f\t%.1f%%" %
(100*(1-threedice[1][3]), 100*(1-threedice[2][3]), 100*(1-threedice[3][3]), 100*(1-threedice[4][3]), 100*(1-threedice[5][3]), 100*(1-threedice[6][3] ),
100*(1-threedice[7][3]), 100*(1-threedice[8][3]), 100*(1-threedice[9][3]), 100*(1-threedice[10][3]), 100*(1-threedice[11][3]), 100*(1-threedice[12][3]),
100*(1-threedice[13][3]), 100*(1-threedice[14][3]), 100*(1-threedice[15][3]), 100*(1-threedice[16][3]), 100*(1-threedice[17][3]), 100*(1-threedice[18][3]),
threedice[0][4], 100*thd_opchance[4][4]))
print("4D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f\t%.1f%%" %
(100*(1-fourdice[1][3]), 100*(1-fourdice[2][3]), 100*(1-fourdice[3][3]), 100*(1-fourdice[4][3]), 100*(1-fourdice[5][3]), 100*(1-fourdice[6][3] ),
100*(1-fourdice[7][3]), 100*(1-fourdice[8][3]), 100*(1-fourdice[9][3]), 100*(1-fourdice[10][3]), 100*(1-fourdice[11][3]), 100*(1-fourdice[12][3]),
100*(1-fourdice[13][3]), 100*(1-fourdice[14][3]), 100*(1-fourdice[15][3]), 100*(1-fourdice[16][3]), 100*(1-fourdice[17][3]), 100*(1-fourdice[18][3]),
fourdice[0][4], 100*fod_opchance[4][4]))
print("5D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t\t%.1f\t%.1f%%" %
(100*(1-fivedice[1][3]), 100*(1-fivedice[2][3]), 100*(1-fivedice[3][3]), 100*(1-fivedice[4][3]), 100*(1-fivedice[5][3]), 100*(1-fivedice[6][3] ),
100*(1-fivedice[7][3]), 100*(1-fivedice[8][3]), 100*(1-fivedice[9][3]), 100*(1-fivedice[10][3]), 100*(1-fivedice[11][3]), 100*(1-fivedice[12][3]),
100*(1-fivedice[13][3]), 100*(1-fivedice[14][3]), 100*(1-fivedice[15][3]), 100*(1-fivedice[16][3]), 100*(1-fivedice[17][3]), 100*(1-fivedice[18][3]),
fivedice[0][4], 100*fid_opchance[4][4]))
print("\nMiscast/OP\tBroCon\tWiFi\tMagInf\tAmn\tBackl\tImplo\tBitV")
print("1D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%" % (0, 0, 0, 0, 0, 0, 0))
print("2D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%" % (0, 0, 0, 0, 0, 0, 0))
print("3D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%" %
(thd_opchance[4][4]*100*1/6, thd_opchance[4][4]*100*1/6, thd_opchance[4][4]*100*1/6,
thd_opchance[4][4]*100*1/6, thd_opchance[4][4]*100*1/6, 0, 0))
print("4D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%" %
(fod_opchance[4][4]*100*1/6, fod_opchance[4][4]*100*1/6, fod_opchance[4][4]*100*1/6,
fod_opchance[4][4]*100*1/6, fod_opchance[4][4]*100*1/6, fod_opchance[4][4]*100*1/6, 0))
print("5D6\t\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%\t%.1f%%" %
(0, fid_opchance[4][4]*100*1/6, fid_opchance[4][4]*100*1/6,
fid_opchance[4][4]*100*1/6, fid_opchance[4][4]*100*1/6, fid_opchance[4][4]*100*1/6, fid_opchance[4][4]*100*1/6))
# print("\nThaumaturgy")
# print("Miscast/OP\tAmnesia\tCD\tBitV")
# print("1D6\t\t%.1f%%\t%.1f%%\t%.1f%%" % (0, 0, 0))
# print("2D6\t\t%.1f%%\t%.1f%%\t%.1f%%" % (twd_opchance[4][4]*100*1/3*0.5, 0, 0))
# print("3D6\t\t%.1f%%\t%.1f%%\t%.1f%%" % (thd_opchance[4][4]*100*2/3*0.5, thd_opchance[4][4]*100*1/3*0.5, 0))
# print("4D6\t\t%.1f%%\t%.1f%%\t%.1f%%" % (fod_opchance[4][4]*100*3/3*0.5, fod_opchance[4][4]*100*2/3*0.5, fod_opchance[4][4]*100*1/3*0.5))
# print("5D6\t\t%.1f%%\t%.1f%%\t%.1f%%" % (fid_opchance[4][4]*100*3/3*0.5, fid_opchance[4][4]*100*2/3*0.5, fid_opchance[4][4]*100*1/3*0.5))
if __name__ == "__main__":
main()