
Round robin tournament calculator
- or -
Post a project like this3377
$$
- Posted:
- Proposals: 4
- Remote
- #1300398
- Awarded
Description
Experience Level: Intermediate
I am looking for a php class that can calculate a schedule for a round robin tournament, what I have found available online doesn't actually fit.
For example:
[
Pass various values to the class:
1) Team names
team 1,team 2,team 3,team 4,team 5,team 6,team 7,team 8
2) Start date (dd-mm-yyyy)
20-10-2016
3) How many days between each of the fixtures
7 days
4) Add any exclusion dates (dd-mm-yyyy) and exclusion reason, example for XMas:
From: 22-12-2016
To: 07-01-2017
Exclusion reason: Christmas break
Fixtures would not be set between these dates but the text for exclusion reason would be so people know why this break exists.
5) Add any other exclusion day dates (dd-mm-yyyy) and reason for exclusion, example for St Valentines:
Exclusion date 1: 14-02-2017
Exclusions date reason 1: St Valentines
Exclusion date 2: '' (If any)
Exclusions date reason 2: ''
Exclusion date 3: '' (If any)
Exclusions date reason 3: ''
This way if a fixture date falls on St. Valentines or any other bank holiday entered that date would be not set as a fixture date but the reason for the exclusion would be output.
6) Add if a single round robin or double round robin:
A single round robin is where every team entered plays the other one time but as evenly as possible. If there where 8 teams for example then teams would either have 4 homes and 3 aways or homes and 4 aways but would play every other team once and no team would have 5 homes and 3 aways.
A double round robin is where every team plays every other team twice, one home game and one away game. All teams have an even number of home and away games so if there where 8 teams then there would be 7 home games and 7 away games.
]
a) I would like to use this from a web page, so I would set up a form with the various input options then output the results in order to the page by including the class.
b) I would like to have the date output for each fixture something like the attached example.
c) If there where an odd number of teams then a "BYE" team name would need to be added to balance the number up so there are an even number of teams, then each team would appear on the output as having an even number of BYE games.
d) Not sure if this is possible: There could be a situation where 2 teams play from the same venue, in this case both teams could never be at home or away together, if both drawn at home then both teams could not play, if drawn away then it wouldn't balance up for home games. This might be a situation for several teams, for example: Team happy 1, team happy 2, team racers, team diamond, team kings, team queens, team horses, team boys, team girls, team aces.
Team happy 1, team happy 2 would be from the bar happy and they can only play one game of an evening, team boys, team girls would be from another bar and they would only be able to play one game of an evening. So if there where a way of coping with this issue then even better.
At the moment I do the fixtures by hand so it is easy to swap them round to make everything balanced, I have to do this a couple of times a year and it can take a while so for that reason I am looking at the possible php solution. I have looked at this myself but while I am no expert in php, what I have is not very elegant or properly balanced.
For example:
[
Pass various values to the class:
1) Team names
team 1,team 2,team 3,team 4,team 5,team 6,team 7,team 8
2) Start date (dd-mm-yyyy)
20-10-2016
3) How many days between each of the fixtures
7 days
4) Add any exclusion dates (dd-mm-yyyy) and exclusion reason, example for XMas:
From: 22-12-2016
To: 07-01-2017
Exclusion reason: Christmas break
Fixtures would not be set between these dates but the text for exclusion reason would be so people know why this break exists.
5) Add any other exclusion day dates (dd-mm-yyyy) and reason for exclusion, example for St Valentines:
Exclusion date 1: 14-02-2017
Exclusions date reason 1: St Valentines
Exclusion date 2: '' (If any)
Exclusions date reason 2: ''
Exclusion date 3: '' (If any)
Exclusions date reason 3: ''
This way if a fixture date falls on St. Valentines or any other bank holiday entered that date would be not set as a fixture date but the reason for the exclusion would be output.
6) Add if a single round robin or double round robin:
A single round robin is where every team entered plays the other one time but as evenly as possible. If there where 8 teams for example then teams would either have 4 homes and 3 aways or homes and 4 aways but would play every other team once and no team would have 5 homes and 3 aways.
A double round robin is where every team plays every other team twice, one home game and one away game. All teams have an even number of home and away games so if there where 8 teams then there would be 7 home games and 7 away games.
]
a) I would like to use this from a web page, so I would set up a form with the various input options then output the results in order to the page by including the class.
b) I would like to have the date output for each fixture something like the attached example.
c) If there where an odd number of teams then a "BYE" team name would need to be added to balance the number up so there are an even number of teams, then each team would appear on the output as having an even number of BYE games.
d) Not sure if this is possible: There could be a situation where 2 teams play from the same venue, in this case both teams could never be at home or away together, if both drawn at home then both teams could not play, if drawn away then it wouldn't balance up for home games. This might be a situation for several teams, for example: Team happy 1, team happy 2, team racers, team diamond, team kings, team queens, team horses, team boys, team girls, team aces.
Team happy 1, team happy 2 would be from the bar happy and they can only play one game of an evening, team boys, team girls would be from another bar and they would only be able to play one game of an evening. So if there where a way of coping with this issue then even better.
At the moment I do the fixtures by hand so it is easy to swap them round to make everything balanced, I have to do this a couple of times a year and it can take a while so for that reason I am looking at the possible php solution. I have looked at this myself but while I am no expert in php, what I have is not very elegant or properly balanced.
Mike B.
100% (3)Projects Completed
3
Freelancers worked with
3
Projects awarded
50%
Last project
8 Oct 2017
Spain
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-

Are you in a rush or flexible on deadline?
Mike B.26 Sep 2016Hi, Thanks you for your interest but I have already accepted a proposal.
Regards
Mike -

What is your budget?
When do you want me to complete this work?Mike B.26 Sep 2016I do not have an exact budget, I would be interested in a quote.
I would like this as soon as possible after we clarify any details and I decide which developer I go forward with. I would also be interested in knowing if you have understood the requirements correctly.
164184164101
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies