# Team vs Team?

Hey y'all,

struggling a little with a problem n wondering if anyone can help:

I need to write a procedure for creating a season of matches in a bowling league. Each team may only play the other once and every team must play on any one matchday...

I have a method to extapolate the correct team matches

team 1 2 3 4 5 6 7 8 9 10
1 x m m m m m m m m m
2 x x m m m m m m m m
3 x x x m m m m m m m
4 x x x x m m m m m m
5 x x x x x m m m m m
6 x x x x x x m m m m
7 x x x x x x x m m m
8 x x x x x x x x m m
9 x x x x x x x x x m
10 x x x x x x x x x x

from the table if you take every m to be a match and every x to be no match then each team is set to play the other once. if you take the horizontal of the table to be x and the vertical to be y a very simple statement can produce the table:

for y:=1 to numteams do
for x:=1 to numteams do
if x>y then match
else nomatch;

the problem is that i now have to place the matches into matchdays :

every team must play another, on any one match day
a team may not play more than once a day

i cannot come up with a method apart from checking the contents of a match day to equally (same num of matches eaxh day) space out the teams into matchdays.... if anyone has any ideas please help

Der_ranga

• : Hey y'all,
:
: struggling a little with a problem n wondering if anyone can help:
:
: I need to write a procedure for creating a season of matches in a bowling league. Each team may only play the other once and every team must play on any one matchday...
:
: I have a method to extapolate the correct team matches
:
: team 1 2 3 4 5 6 7 8 9 10
: 1 x m m m m m m m m m
: 2 x x m m m m m m m m
: 3 x x x m m m m m m m
: 4 x x x x m m m m m m
: 5 x x x x x m m m m m
: 6 x x x x x x m m m m
: 7 x x x x x x x m m m
: 8 x x x x x x x x m m
: 9 x x x x x x x x x m
: 10 x x x x x x x x x x
:
: from the table if you take every m to be a match and every x to be no match then each team is set to play the other once. if you take the horizontal of the table to be x and the vertical to be y a very simple statement can produce the table:
:
:
: for y:=1 to numteams do
: for x:=1 to numteams do
: if x>y then match
: else nomatch;
:
: the problem is that i now have to place the matches into matchdays :
:
: every team must play another, on any one match day
: a team may not play more than once a day
:
: i cannot come up with a method apart from checking the contents of a match day to equally (same num of matches eaxh day) space out the teams into matchdays.... if anyone has any ideas please help
:
:
: Der_ranga
:

Let's say you have the matrix in code, and in each cell you can specify an integer. 0 is available, 1 is not available, 2 is a match.

To determine the matches for one day:

Select one specific match (random perhaps). In the matrix you have (see above) put a 2 in that cell. Then go up, down, left and right from that cell, and put 1's in them. Select a new cell which has a 0 in it, and redo the procedure until there are no 0's left. Voila, your match-day!

For the next match day. Disable the cells you already selected with a 3 so you can see that they were already played.
• : : Hey y'all,
: :
: : struggling a little with a problem n wondering if anyone can help:
: :
: : I need to write a procedure for creating a season of matches in a bowling league. Each team may only play the other once and every team must play on any one matchday...
: :
: : I have a method to extapolate the correct team matches
: :
: : team 1 2 3 4 5 6 7 8 9 10
: : 1 x m m m m m m m m m
: : 2 x x m m m m m m m m
: : 3 x x x m m m m m m m
: : 4 x x x x m m m m m m
: : 5 x x x x x m m m m m
: : 6 x x x x x x m m m m
: : 7 x x x x x x x m m m
: : 8 x x x x x x x x m m
: : 9 x x x x x x x x x m
: : 10 x x x x x x x x x x
: :
: : from the table if you take every m to be a match and every x to be no match then each team is set to play the other once. if you take the horizontal of the table to be x and the vertical to be y a very simple statement can produce the table:
: :
: :
: : for y:=1 to numteams do
: : for x:=1 to numteams do
: : if x>y then match
: : else nomatch;
: :
: : the problem is that i now have to place the matches into matchdays :
: :
: : every team must play another, on any one match day
: : a team may not play more than once a day
: :
: : i cannot come up with a method apart from checking the contents of a match day to equally (same num of matches eaxh day) space out the teams into matchdays.... if anyone has any ideas please help
: :
: :
: : Der_ranga
: :
:
: Let's say you have the matrix in code, and in each cell you can specify an integer. 0 is available, 1 is not available, 2 is a match.
:
: To determine the matches for one day:
:
: Select one specific match (random perhaps). In the matrix you have (see above) put a 2 in that cell. Then go up, down, left and right from that cell, and put 1's in them. Select a new cell which has a 0 in it, and redo the procedure until there are no 0's left. Voila, your match-day!
:
: For the next match day. Disable the cells you already selected with a 3 so you can see that they were already played.
:

FOLLOWING EXAMPLES ARE I BELIEVE AN EXTRAPOLATION OF PRITEAS'S METHOD FOR SOLVING THE AFOREMENTIONED PROBLEM :

IM NOT SURE OF THE METHOD PRITEAS... THE WAY I SEE IT THE UP DOWN LEFT RIGHT PROCEDURE DOESNT WORK AND IT WOULD ACTUALLY MEAN PROGRESSIN THROUGHOUT MORE OF THE MATRIX I.E..
STARTING MATRIX:

T 1 2 3 4 5 6 7 8 9 10
1 X 0 0 0 0 0 0 0 0 0
2 X X 0 0 0 0 0 0 0 0
3 X X X 0 0 0 0 0 0 0
4 X X X X 0 0 0 0 0 0
5 X X X X X 0 0 0 0 0
6 X X X X X X 0 0 0 0
7 X X X X X X X 0 0 0
8 X X X X X X X X 0 0
9 X X X X X X X X X 0
10 X X X X X X X X X X

SELECTED RANDOMLY MATCH ( 3 V 8 )
THIS IS HOW I UNDERSTAND YOUR SOLUTION TO WORK :

T 1 2 3 4 5 6 7 8 9 10
1 X 0 0 0 0 0 0 1 0 0
2 X X 0 0 0 0 0 1 0 0
3 X X X 1 1 1 1 2 1 1
4 X X X X 0 0 0 1 0 0
5 X X X X X 0 0 1 0 0
6 X X X X X X 0 1 0 0
7 X X X X X X X 1 0 0
8 X X X X X X X X 0 0
9 X X X X X X X X X 0
10 X X X X X X X X X X

HOWEVER I FEEL THAT YOUR SOLUTION WOULD ONLY WORK IF THE FOLLOWING WERE TO HAPPEN INSTEAD:

STARTING MATRIX
T 1 2 3 4 5 6 7 8 9 10
1 X 0 0 0 0 0 0 0 0 0
2 X X 0 0 0 0 0 0 0 0
3 X X X 0 0 0 0 0 0 0
4 X X X X 0 0 0 0 0 0
5 X X X X X 0 0 0 0 0
6 X X X X X X 0 0 0 0
7 X X X X X X X 0 0 0
8 X X X X X X X X 0 0
9 X X X X X X X X X 0
10 X X X X X X X X X X

AS SHOWN FOLLOWING UPON RANDOMLY SELECTING A MATCH ( 3 V 8 ) NOT ONLY DO I HAVE TO CHANGE THE UP DOWN LEFT AND RIGHT BUT ALSO ANY CELL CORRESPONDING TO ONE OF THE TEAMS (3 / 8)

T 1 2 3 4 5 6 7 8 9 10
1 X 0 1 0 0 0 0 1 0 0
2 X X 1 0 0 0 0 1 0 0
3 X X X 1 1 1 1 2 1 1
4 X X X X 0 0 0 1 0 0
5 X X X X X 0 0 1 0 0
6 X X X X X X 0 1 0 0
7 X X X X X X X 1 0 0
8 X X X X X X X X 1 1
9 X X X X X X X X X 0
10 X X X X X X X X X X

PERHAPS THE LATTER WAS YOUR ORIGINAL INTENT?
OR AM I MISSING THE POINT OF YOUR SUGGESTION?

CHEERS DER _ RANGA
• : PERHAPS THE LATTER WAS YOUR ORIGINAL INTENT?
: OR AM I MISSING THE POINT OF YOUR SUGGESTION?

No, you're correct. I missed the point that you were looking for the matches on a given day.