Ok, guess I'll pass on this one, I thought I explained it in simple terms, but it sounds like
I don't understand what exactly is required. my take was you simply take 40 games
and evenly spread out the match ups between 8 teams?. that's it.
When you think about it
a bye is nothing more then just like facing another team only you don't play that. I found
some open source league scripts I will install and play with,
I still say the basic schedule function theory should work with number of teams, and
number of games. the hard part is spreading the match ups evenly among all of them.
that's why I sought help here.
I found this script below, problem is it errors when it gets to the part teams play more
then once and also there is no way to enter total games played. but this is something like
how to do it.
PHP Code:
class schedule{
var $history=array();
var $num=10;
var $a=array();
function make_teams(){
for($i=1;$i<=$this->num;$i++){
$this->a[]="team ".$i;
}
}
function remove_history($team1,$team2){
if(sizeof($this->history)>0){
foreach($this->history[$team1] as $key => $val){
if($val==$team2&&$val){
$this->history[$team1][$key]=0;
break;
}
}
}
}
// Do It, make the schedule
$s=new schedule();
//number of teams
$s->num=16;
//makes the teams
$s->make_teams();
//makes the history-all the possibilities of the teams(team1 can play against all and so on)
$s->make_history();
Right, which is what the combinations will do for you.
If you run that with 8 teams (which is successful), it will specify 4x teams over 7 weeks, and won't accommodate anything over 7 weeks. Which is expected. If you used 12 (and the script wasn't fubard), it would specify 6 games for 11 weeks.
So scheduling a combination without repeating a team per week is mostly trivial to do. Specifying missing days or overages require a custom ruleset to deal with them. If I specified 3 teams total, then there would be 3 games in total to deal with every combination. That would be 1 game per week for 3 weeks. So what would happen with the other 7 weeks?
Right, which is what the combinations will do for you.
If you run that with 8 teams (which is successful), it will specify 4x teams over 7 weeks, and won't accommodate anything over 7 weeks. Which is expected. If you used 12 (and the script wasn't fubard), it would specify 6 games for 11 weeks.
So scheduling a combination without repeating a team per week is mostly trivial to do. Specifying missing days or overages require a custom ruleset to deal with them. If I specified 3 teams total, then there would be 3 games in total to deal with every combination. That would be 1 game per week for 3 weeks. So what would happen with the other 7 weeks?
Fou Check this out
Just in case anybody out there is also looking to do something like this, its not done its
probably not even the best way to it, but it works, as I said earlier its not that complex as
it appears, note the teams and start times, it will take whatever number of teams and
start times and do a schedule for you just pass it the number of weeks and it does the
rest.
I'd appropriate, any advice on improving or styling this better
PHP Code:
// If you wind up with odd number teams, simply add bye as shown.
Spring 13 Boys Week 2 2013-02-10 11am Team 1 vs team7
Spring 13 Boys Week 9 2013-03-31 9am Team 1 vs team7
You have a few like that; ultimately this is exactly what my question has been. How do you control whom replays whom when you cannot allot everyone playing every team twice.
It doesn't work properly though. It looks to me that you'll end up with. . . 44 records in there, so that'll be 11 weeks worth, not 10. Since 44 doesn't work with a full combination calculation on sets of 2x, without being able to parse this code entirely (writecodeonline is unhappy about the buffer sizes its using), I can't tell whether it's short or just over.
Spring 13 Boys Week 2 2013-02-10 11am Team 1 vs team7
Spring 13 Boys Week 9 2013-03-31 9am Team 1 vs team7
You have a few like that; ultimately this is exactly what my question has been. How do you control whom replays whom when you cannot allot everyone playing every team twice.
It doesn't work properly though. It looks to me that you'll end up with. . . 44 records in there, so that'll be 11 weeks worth, not 10. Since 44 doesn't work with a full combination calculation on sets of 2x, without being able to parse this code entirely (writecodeonline is unhappy about the buffer sizes its using), I can't tell whether it's short or just over.
I have always been saying this I'm just looking to create match ups for whatever amount
of teams and start times for 10 weeks. Its as close as you can get, everyone has a match
up for 10 weeks and the times and byes are spread out best as possible. this does exactly
that, problem I am having now is styling the results within the implode, I don't want week
1 on every entry just that group for that week only once, I think the way I did this does
not allow easy format styling.