Ah ok. Well here is a different way to do it. since it's only six different teams you can combine the pair in one number, and instead of generating it with code (which you still could do), you could just populate the array with this: It will be a 5x3 array.

Three pairs per week for five weeks.

```
12 13 14 15 16
34 25 35 24 23
56 46 26 36 45
```

you can swap rows/columns and pairs in the same column.

For all 15 weeks. just the above duplicated three times. A 3x15 array.

```
12 13 14 15 16 12 13 14 15 16 12 13 14 15 16
34 25 35 24 23 34 25 35 24 23 34 25 35 24 23
56 46 26 36 45 56 46 26 36 45 56 46 26 36 45
```

You can still swap stuff around but you can cause the same match to occur on consecutive weeks.

To check you can do this:

```
global number x=0
global number y=0
for "x" from 0 to 15-2
for "y" from 0 to 3-1
-- set x to loopindex("x")
-- set y to loopindex("y")
-- if array.at(x,y)=array.at(x+1,y)
-- or array.at(x,y)=array.at(x+1,(y+1)%3)
-- or array.at(x,y)=array.at(x+1,(y+2)%3)
-- -- ... there is the same match on consecutive weeks.
```

Probably the algo at that point would be:

1. load intial array values.

2. swap stuff around

3. check if there are any repeat matches from one week to the next.

4. if there are repeats go back to 2 and try again.

5. otherwise you have a good layout.

That could succeed first try or never succeed.

You probably can do something smarter by knowing that there are ony five different weeks of pairs.

Then it simplifies to a string a sting of numbers

123451234512345

Then just scramble those around, and then fill the weeks in the array form that. Then all that would be left is to swap items around in each column.

I mean the algo would be the same, just simpler to do.