def schedule_matches(self):
mySchedule = []
# for each home team
for home in range(len(self.clubs)):
for away in range(len(self.clubs)):
if home == away:
continue
# schedule will be in order at first
match = Match(self.clubs[home], self.clubs[away])
mySchedule.append(match)
# TODO: This will need majorly improved.
# Issue created on github
away += 1
# shuffle that schedule
random.shuffle(mySchedule)
# set current schedule to the new one
self.schedule = mySchedule
评论列表
文章目录