 cdog Boo Premium join:2001-10-11 Chicago, IL clubs:
| PHP help Hi. I am creating a script for a tournament website i am building for a racing game.
But of course I've run into a snag
the way it works is this
the tournament can have minimum 1 rider to maximum 144
each race room can have maximum 12 riders
the script i have auto-creates the first set of races "heats" perfectly.
the problem i am running into is with the 2nd set of races "semis"
for the semis i take up to maximum top 48 riders from heats. my script works great if i have an even amount of riders going into each semi (max 4 semi rooms at 12 riders each room)
here is an example with an even amount of riders per semi. »onitracing.net/test.php?totalriders=144
now here is an example of when i don't have the same amount of riders in each semi. »onitracing.net/test.php?totalriders=76
as you can see it can't properly calculate the riders in each heat.
the thing making it so hard is i want the positions to be staggered from each heat. meaning i don't want all 1st place to go to semi 1, 2nd place to semi 2 etc. i want them to be spread out evenly to each semi.
here is the script. i have been working on it for 2 days and it's driving me insane now.
»cdog.pastebin.com/m7a421e6
to see how the script reacts with different amounts of riders just change totalriders in the url to anything from 1-144 -- If what ya got is perfect and you always want better. Happiness will never come. - [Have Some Fun] - |