-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
91 lines (81 loc) · 3.44 KB
/
main.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
#!/usr/bin/env python3
import club
from sim import Simulation
from loading import Load
clubs = ['ADO Den Haag','Ajax','AZ','de Graafschap','Excelsior','FC Emmen','FC Groningen','FC Utrecht','Feyenoord',
'Fortuna Sittard','Heracles Almelo','NAC Breda','PEC Zwolle','PSV','SC Heerenveen','Vitesse','VVV-Venlo','Willem II']
leagues = [
['Eredivisie',
[['ADO Den Haag', 69],['Ajax', 76],['AZ', 73],['de Graafschap', 60],['Excelsior', 68],
['FC Emmen', 60],['FC Groningen', 68],['FC Utrecht', 72],['Feyenoord', 76],['Fortuna Sittard', 60],['Heracles Almelo', 69],
['NAC Breda', 67],['PEC Zwolle', 70],['PSV', 75],['SC Heerenveen', 70],['Vitesse', 71],['VVV-Venlo', 67],['Willem II', 68]]],
['Eerste Divisie',
[['Almere City FC', 60],['FC Den Bosch', 60],['FC Dordrecht', 60],['FC Eindhoven', 60],['FC Twente', 60],['FC Volendam', 60],
['Go Ahead Eagles', 60],['Helmond Sport', 60],['Jong Ajax', 60],['Jong AZ', 60],['Jong FC Utrecht', 60],['Jong PSV', 60],
['MVV Maastricht', 60],['N.E.C.', 60],['RKC Waalwijk', 60],['Roda JC', 60],['SC Cambuur', 60],['Sparta Rotterdam', 60],
['Telstar', 60],['TOP Oss', 60]]]
]
class Main(object):
"""docstring for Main."""
def __init__(self):
super(Main, self).__init__()
self.main()
def welcome(self):
print(" __ __ _ _ _ _____ _")
print(" \ \ / / | | | | | | / ____(_)")
print(" \ \ / /__ ___| |_| |__ __ _| | | (___ _ _ __ ___")
print(" \ \/ / _ \ / _ \ __| '_ \ / _` | | \___ \| | '_ ` _ \ ")
print(" \ / (_) | __/ |_| |_) | (_| | | ____) | | | | | | |")
print(" \/ \___/ \___|\__|_.__/ \__,_|_| |_____/|_|_| |_| |_|")
print("")
print('welcome to Voetbal Sim')
def menu(self):
print('[1] New Game \n[2] Career mode \n[3] Info \n[4] Quit')
option = int(input('your choice: '))
if option == 1:
print('New Game')
teams = self.selection()
self.quick_match(teams)
self.menu()
elif option == 2:
load = Load()
print('[1] - New Career \n[2] - Load Career')
option = int(input())
if option == 1:
load.create()
if option == 2:
load.load()
else:
self.menu()
elif option == 3:
print('Info')
print('Voetbal_Sim is a football simulator based upon fifa career mode.')
self.menu()
else:
exit()
def selection(self):
print('Choose your team:')
for team in range(0,len(clubs)):
print('[{}] - {}'.format(team, clubs[team]))
option = int(input())
home = club.Club(clubs[option])
print(home.name)
print('Choose your opponent:')
for team in range(0,len(clubs)):
print('[{}] - {}'.format(team, clubs[team]))
option = int(input())
away = club.Club(clubs[option])
print(away.name)
return(home, away)
def main(self):
self.welcome()
self.menu()
def quick_match(self, teams):
home = teams[0]
away = teams[1]
print('Selected teams: \n {} vs {}'.format(home.name, away.name))
input('press enter to continue')
result = Simulation.simulate(teams)
print(' {} vs {}\n {} - {}'.format(result[0].name, result[1].name, result[0].result, result[1].result))
if __name__ == '__main__':
Main()