Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function to create Sports Ladder Printout

Status
Not open for further replies.

crewchiefpro6

Programmer
Mar 22, 2005
204
US
Has anyone ever tried to calculate and display a sports ladder? For example, in the drag racing world, if there are 127 entrants in a class I need to display the ladder used during eliminations. The ladder is calculated after first round, so I need to pare up (127 / 2) = 64 race cars. We also rank the cars by their qualifying positions. First round does not need a ladder, since you have no idea who you race in this round. All the later rounds are in order.

With this example there are always 2 cars per race UNLESS there is an uneven number, then one gets a free run by themselves. So there would be (64 / 2) + 1 bye run = 33 races.

The next round divides this by 2 and pares up the remaining cars. This continues until there are 2 cars left.

I would like to create a function to draw a line between the 2 cars and continue until there is one remaining car.

The math should not be difficult, the lines between the cars might be harder. The number of ladder rungs changes each event, since there are never the same number of cars entered.

Any ideas?



Don Higgins
 
I can't think how to draw lines between records but you could colour the rows in the grid two by two to show who's racing whom. The Solutions app shows how to generate ledger-style green and white rows. That uses Recno()%2 to set DynamicBackColor and distinguish between odd and even lines. Try RecNo()%4 < 2 to give you one colour for lines 1 & 2, 5 & 6, 9 & 10 etc and another colour for 3 & 4, 7 & 8, etc.

Geoff Franklin
 
Have you considered using software that's already out there which does just this?

I've had a large part in writing Tournament Time ( ), which will handle up to 128 participants in a tournament, and handles the bye issue you mention.

Unfortunately, I can't reveal the internal method we use for drawing the chart... it's a trade secret ;-)

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Bill, the reason I don't want to buy a commercial system is this has to be integrated into my program. I can write the logic, its the lines that are the issue since I want the logic to draw itself right on my form at the click of a button, and redraw itself when something changes.

I also have the program automatically pull up the next opponent, calculate their strengths and weaknesses instantly, and show where my customer needs to improve in order to win.



Don Higgins
 
Well, While your customer base doesn't really intersect with ours, this is a public forum, so I can't reveal too much.

But, Here's a hint that I think will get you going in the right direction.. Notice that an elimination tournament is really just a binary tree, and each round forward has half the number of nodes, but twice as much space in-between the nodes. This works pretty easily into a formula for the locations of each match...

(Our real secrets are related to double-elimination tournaments, where losers from a single elimination bracket feed into a loser's bracket which hardly has a similar shape)

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
I haven't given this much thought but I would likely examine the report writer to create the diagrams and use Print Preview to see the results on screen.

C.Davis
 
Good idea C.Davis, I figured that would be the best way to draw the information. I am not sure if it could handle 8 rounds but it might when I switch to Landscape.


Don Higgins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top