I am building a bracket system (double elimination) and need to figure out how to create a loop that will return the proper matches according to seed.
For example, if a tournament has 8 teams the seeds would line up as follows:
Array(1,8,5,4,3,6,7,2);
Now I have temporarily built this into a static array:
Does anyone have any ideas how I can put a formula into a for loop that will generate this rather than having to build static arrays? The reasoning is due to having either 8, 16, 32 or 64 teams.PHP Code:$this->seedData[8] = array(
1 => array(1,8,5,4,3,6,7,2),
2 => array(1,4,3,2),
3 => array(1,2),
4 => array(1)
);
Thanks to anyone who is able to assist.




Reply With Quote