elwinh
09-09-2007, 01:32 PM
I need to make a script that can make 2 player teams from the input players.
The input are the players. The script must make teams with evry player. So, if you put in:
player 1
player 2
player 3
player 4
The output must be:
round 1:
player 1 vs player 2
player 3 vs player 4
round 2:
player 1 vs player 3
player 2 vs player 4
round 3:
player 1 vs player 4
player 2 vs player 3
Evryone must play against evryone.
And now the hard part, round 1 is played in 1 week, round 2 in the next, round 3 next.
So, the combinations must be stored in the db and must be echo-ed evry week. If someone is not there, that teammember must be filtered out. (collection of ppl that are not there will be farmed with a form)
Example:
round 1:
player 1 vs player 2
player 3 vs player 4
round 2:
player 2 vs player 4
Player 1 don't have to play this week
player 3 could'nt come
round 3:
player 1 vs player 4
player 2 vs player 3
round 4:
player 1 vs player 3
If 2 ppl are not there, the script must check if there are other combinations possible to let evrybody play. (and not play twice against eachother in the competition)
example:
round 1:
player 1 vs player 3
Player 2 and player 4 could'nt come.
round 2:
player 1 vs player 2
player 3 vs player 4
round 3:
player 1 vs player 4
player 2 vs player 3
round 4:
player 2 vs player 4
If ppl had less matches played as other members, they must get priority.
There are not loosers here. Avryone will be able to play evry week if they are there.
Can some1 get me on the right way?
The input are the players. The script must make teams with evry player. So, if you put in:
player 1
player 2
player 3
player 4
The output must be:
round 1:
player 1 vs player 2
player 3 vs player 4
round 2:
player 1 vs player 3
player 2 vs player 4
round 3:
player 1 vs player 4
player 2 vs player 3
Evryone must play against evryone.
And now the hard part, round 1 is played in 1 week, round 2 in the next, round 3 next.
So, the combinations must be stored in the db and must be echo-ed evry week. If someone is not there, that teammember must be filtered out. (collection of ppl that are not there will be farmed with a form)
Example:
round 1:
player 1 vs player 2
player 3 vs player 4
round 2:
player 2 vs player 4
Player 1 don't have to play this week
player 3 could'nt come
round 3:
player 1 vs player 4
player 2 vs player 3
round 4:
player 1 vs player 3
If 2 ppl are not there, the script must check if there are other combinations possible to let evrybody play. (and not play twice against eachother in the competition)
example:
round 1:
player 1 vs player 3
Player 2 and player 4 could'nt come.
round 2:
player 1 vs player 2
player 3 vs player 4
round 3:
player 1 vs player 4
player 2 vs player 3
round 4:
player 2 vs player 4
If ppl had less matches played as other members, they must get priority.
There are not loosers here. Avryone will be able to play evry week if they are there.
Can some1 get me on the right way?