-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatchSimulator.py
More file actions
50 lines (48 loc) · 1.38 KB
/
MatchSimulator.py
File metadata and controls
50 lines (48 loc) · 1.38 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
50
import random
PremList = {
"1": 84,
"2": 76,
"3": 57,
"4": 66,
"5": 72,
"6": 34,
}
PremName = {
"1": "Arsenal",
"2": "Aston Villa",
"3": "Bournemouth",
"4": "Brentford",
"5": "Brighton",
"6": "Burnley"
}
Lower_Range = 45
Upper_Range = 55
print("What 2 teams do you want to simulate a match between? Type the number that is in brackets beside the team")
Team1 = input("Arsenal (1), Aston Villa (2), Bournemouth (3), Brentford (4), Brighton (5), Burnley (6): ")
Team2 = input("Arsenal (1), Aston Villa (2), Bournemouth (3), Brentford (4), Brighton (5), Burnley (6): ")
if Team1 == Team2:
print("No, do not pick 2 teams of the same")
exit()
else:
pass
if Team1 in PremList and Team2 in PremList:
if PremList[Team1] > PremList[Team2]:
Thing = random.randint(1,100)
if Thing < PremList[Team2]:
print(PremName[Team2], "won")
elif Thing < PremList[Team1] and Thing > PremList[Team2]:
print(PremName[Team1],"won")
elif Lower_Range <= Thing <= Upper_Range:
print("The result was a draw")
else:
print("Broken Code")
else:
Thing = random.random.randint(1,100)
if Thing > PremList[Team2]:
print(PremName[Team2], "won")
elif Thing > PremList[Team1] and Thing < PremList[Team2]:
print(PremName[Team1],"won")
elif Lower_Range >= Thing >= Upper_Range:
print("The result was a draw")
else:
print("Broken Code")