The Tournament Director Forums

Main => Help Me => Topic started by: Linker_Split on August 09, 2010, 08:25:28 PM

Title: scoring formula
Post by: Linker_Split on August 09, 2010, 08:25:28 PM
hi everybody,
I'm testing a formula I've just created it's very simple, but I would like to knowe if it will return the correct results:

if(rank <= ((numberofPlayers/100)*10),((numberofPlayers/100)*10) - rank, 0)

basically i want to award the top 10% of players with points, so if 100 players, only 10 players with points, if 1200 players, only 120 players...
is it correct?
Title: Re: scoring formula
Post by: Linker_Split on August 09, 2010, 08:37:11 PM
Also, why this doesn't work?

assign("tot_pls",((numberofPlayers/100)*10))

if(rank <= tot_pls,tot_pls - rank, 0)

basically what I'm doing is assigning "tot_pls" the value of 10% of players...

@EDIT

Oh I found it doesn't allow me to use the underscore _
Title: Re: scoring formula
Post by: Magic_fubu on August 09, 2010, 08:55:33 PM
if(rank <= ((numberofPlayers/100)*10),((numberofPlayers/100)*10) - rank, 0)

Just an observation... why divide by 100 , just to multiply by 10, when you could just as easily divide by ten? simplify it to be the following
Code: [Select]
if(rank <= (NumberOfPlayers/10),(NumberOfPlayers/10)-rank,0)
Title: Re: scoring formula
Post by: Linker_Split on August 09, 2010, 09:05:17 PM
thank you for the answer, I must be tired it's 4 AM Lol
anyway, I managed to get this formula:

10 * [sqrt(n)/sqrt(r)] * [1+log(bc+0,25)]

but I want to give points only to the ITM players.
i sitll don't get the way :(
this formula gives ALL players some points...
Title: Re: scoring formula
Post by: Linker_Split on August 10, 2010, 06:50:44 AM
Ok guys. I think I got it sorted out:

Code: [Select]
assign("pointsPP",(10 * [sqrt(n)/sqrt(r)] * [1+log(bc+0.25)]))

assign("PlayerPaidPoints",(numberofPlayers/10))

if(rank <= PlayerPaidPoints, pointsPP)

this way it will assign the top 10% of players points :)
Title: Re: scoring formula
Post by: Corey Cooper on August 10, 2010, 11:04:59 AM
Looks like you worked it out, but just let me point out one thing: don't use brackets [].  Although in written math formulas they are the same as parentheses (), they are different in most programming languages, and they are different in Tournament Director formulas.  It's basically a quirk of the language that is allowing it to work properly in your formula.  Change the [] to () to save yourself headaches in the future if you run across a formula where it doesn't work like you think it should.