As the old saying goes, “there’s more than one way to skin a cat”. I have a challenge for all bubble enthusiasts to find the simplest solution to a problem.
Back story
Me and my friends loved to play FIFA online against each other so much we decided to create a league of our own. Currently we are managing everything via a spreadsheet and its getting very tiresome, therefor I thought I would challenge myself to create a website where we can create new leagues, manage the teams we use and most importantly create a list of fixtures. I have managed to build a system for creating new leagues, configuring league attributes, inviting users and selecting teams.
The challenge
To generate a list of fixtures based upon the chosen configured league attributes (number of users, number of teams per user and number of play throughs). The list of fixtures needs to be fair and fun therefore, I have a set of rules that need to be honoured.
The rules
- A team cannot play themselves
- If a user has more then 1 team, they cannot play each other.
- Number play throughs will determine Home and Away fixtures.
3a. If no. of play throughs is <1, home and away fixtures are to be created
3b. If no. of play throughs <2, randomise which team plays home
i. no team can have more than half of their fixtures as the home team. - Fixtures are to be separated into gameweeks
4a. Total number of fixtures in a gameweek = all teams play
i. If no of play throughs is > 1, Home and Away fixtures are to be evenly distributed across
gameweeks
Resources
Gsuite with database structure and fixture rules
docs.google.com
Round robin scheduling
en.wikipedia.org
As I have said, there will be a few different solutions to this problem but what I am interested in is the simple solution in means of implementation and performance.
Im keen to see what solutions everyone comes up with!