-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutilsTesting.py
More file actions
49 lines (39 loc) · 1.21 KB
/
utilsTesting.py
File metadata and controls
49 lines (39 loc) · 1.21 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
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 29 16:14:30 2021
@author: Daniel Mishler
"""
import utils
zombies = []
for i in range(12):
zombies.append(
utils.rollingMonster(22, #HP
utils.Die(6), # Damage Die
1, # Damage bonus
3, # Attack bonus
8, # Armor Class
"zombie {}".format(i+1) # Name
)
)
# for zombie in zombies:
# zombie.show()
troll = utils.rollingTroll()
# utils.fightManyRoll(troll,zombies,suspense=False,printing=True)
# troll.refresh()
# for zombie in zombies:
# zombie.refresh()
file = open("fightSimulation.txt","w")
trollWins = 0
for i in range(1000):
victor = utils.fightManyRoll(troll,zombies,suspense=False,printing=False)
troll.refresh()
for zombie in zombies:
zombie.refresh()
if victor == "Troll":
trollWins += 1
file.write("Troll")
else:
file.write("Zombies")
file.write("\n")
file.close()
print("the troll is expected to win", trollWins, "out of 1000")