I have an array with three elements (round, teamH and teamA). Note that team #1 always appears in the first of any new round.
[round] 1, [teamH] 1, [teamA] 8
[round] 1, [teamH] 2, [teamA] 7
[round] 1, [teamH] 3, [teamA] 6
[round] 1, [teamH] 4, [teamA] 5
[round] 2, [teamH] 1, [teamA] 7
[round] 2, [teamH] 2, [teamA] 8
[round] 2, [teamH] 3, [teamA] 8
[round] 2, [teamH] 4, [teamA] 3
etc
Since these are teams that play every weekend, team number one would be pissed if they always had the 8 am game. I need a way to randomize the games within each round. I inserted a unique, non-repeating randomize number into the mix, figuring I could just sort the array--but here's what's stopping me. I need to sort the 'spot' within in the 'round' without sorting all the 'rounds.'
[spot] 4, [round] 1, [teamH] 1, [teamA] 8
[spot] 3, [round] 1, [teamH] 2, [teamA] 7
[spot] 1, [round] 1, [teamH] 3, [teamA] 6
[spot] 2, [round] 1, [teamH] 4, [teamA] 5
[spot] 1, [round] 2, [teamH] 1, [teamA] 7
[spot] 4, [round] 2, [teamH] 2, [teamA] 8
[spot] 3, [round] 2, [teamH] 3, [teamA] 8
[spot] 2, [round] 2, [teamH] 4, [teamA] 3
etc
So that it looks like this...
[spot] 1, [round] 1, [teamH] 3, [teamA] 6
[spot] 2, [round] 1, [teamH] 4, [teamA] 5
[spot] 3, [round] 1, [teamH] 2, [teamA] 7
[spot] 4, [round] 1, [teamH] 1, [teamA] 8
[spot] 1, [round] 2, [teamH] 1, [teamA] 7
[spot] 2, [round] 2, [teamH] 4, [teamA] 3
[spot] 3, [round] 2, [teamH] 3, [teamA] 8
[spot] 4, [round] 2, [teamH] 2, [teamA] 8
Any ideas. I've scoured the net but couldn't find anything. Could somebody steer me in the right direction?
thanks