Click to See Complete Forum and Search --> : Tennis tournament rounds

11-15-2002, 04:26 PM
Hi, I am trying to make a tennis tournament system, not sure if this is the right place to post, but..
Basically, the tournament can have a maximum of 6 rounds, and I am trying to make an algorithm that can decide on the round name.
Eg, if there are three rounds, round one would be "Quarter final", round two would be "Semi final" and round three would be "Final".

If it had 4 rounds, round 1 would be "1ST" etc..
I'm trying to make a generic algorithm but just cannot come up with one that works.
Does anyone know if this has been done anywhere before, or have any other information?

Any help would be great..

11-18-2002, 01:51 PM
i think i know what you mean.

you could have a look up array.

current_round = 1;

rounds = new Array ("quarter final","semi final","final");

// then to display the round you have

display = rounds[current_round];

// then after each round you need to increase the current_round

current_round ++;

is this what you mean ?

cheers howard