From dd2c995f45df58bcc0636e967c095c40084aa126 Mon Sep 17 00:00:00 2001 From: Chris Tarazi Date: Wed, 12 Dec 2018 22:08:55 -0800 Subject: [PATCH] Update teams for 2018-2019 season Also, look for an optimal draw even earlier due to a situation in this season where Lyon has no possible group winners to match with. --- simulator.py | 34 +++++++++++++++++----------------- templates/index.html | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/simulator.py b/simulator.py index a19b83a..537fb9a 100644 --- a/simulator.py +++ b/simulator.py @@ -15,7 +15,7 @@ ''' This file contains the simulator code for simulating the Round of 16 in the -UEFA Champions League for the 2016-2017 season. +UEFA Champions League for the 2018-2019 season. ''' from collections import defaultdict @@ -23,25 +23,25 @@ import random group_winners = [ - ("A", "ENG", "Manchester United"), - ("B", "FRA", "PSG"), - ("C", "ITA", "AS Roma"), - ("D", "SPA", "FC Barcelona"), - ("E", "ENG", "Liverpool"), + ("A", "GER", "Borussia Dortmund"), + ("B", "SPA", "FC Barcelona"), + ("C", "FRA", "PSG"), + ("D", "POR", "Porto"), + ("E", "GER", "Bayern Munich"), ("F", "ENG", "Manchester City"), - ("G", "TUR", "Besiktas"), - ("H", "ENG", "Tottenham Hotspur") + ("G", "SPA", "Real Madrid"), + ("H", "ITA", "Juventus") ] group_runners = [ - ("A", "SWT", "FC Basel"), - ("B", "GER", "Bayern Munich"), - ("C", "ENG", "Chelsea"), - ("D", "ITA", "Juventus"), - ("E", "SPA", "Sevilla"), - ("F", "UKR", "Shakhtar Donetsk"), - ("G", "POR", "Porto"), - ("H", "SPA", "Real Madrid") + ("A", "SPA", "Atlético Madrid"), + ("B", "ENG", "Tottenham Hotspur"), + ("C", "ENG", "Liverpool"), + ("D", "GER", "Schalke"), + ("E", "NED", "Ajax"), + ("F", "FRA", "Lyon"), + ("G", "ITA", "Roma"), + ("H", "ENG", "Manchester United") ] valid_draws = defaultdict(list) # Holds all valid draws @@ -156,7 +156,7 @@ def _simulate_draw(): while tmp_group_runners and tmp_group_winners: # When half-way complete, try to avoid conflicts if (_need_optimal_draw(tmp_valid_draws, tmp_group_runners) or - len(tmp_group_runners) < 5): + len(tmp_group_runners) < 6): runner_up, winner = _get_optimal_draw(tmp_valid_draws, tmp_group_runners) else: diff --git a/templates/index.html b/templates/index.html index c159d7e..dcc4730 100644 --- a/templates/index.html +++ b/templates/index.html @@ -169,7 +169,7 @@
-

UCL Round of 16 2017-2018 Draw Simulator

+

UCL Round of 16 2018-2019 Draw Simulator

{% with messages = get_flashed_messages() %} {% if messages %}