Author Topic: Need help putting in our league points  (Read 3427 times)

Masterdorf

  • Newbie
  • *
  • Posts: 4
    • View Profile
Need help putting in our league points
« on: April 10, 2008, 09:27:27 PM »
We have a forumla that we use to figure out the points in our league.  I am trying to figure out how to get TD2 to do them.


this is what we do. 
1 point for showing up.
1 Point for each person you out last.
This is where it gets tricky

we take the number of people entered into the tourny and multply by 50%    Then these points are added to the people who finsh in the money.  Points are given out by the same percentage that we pay out.  Lets say we have 24 people playing  thats and extra 12 points.  45% of the 12 points goes to first(5.4)  25% of the 12 points goes to 2nd (3)  place ect ect.


# of players                    1st            2nd                         3rd                       4th                    5th                              6th                              7th
11-15            50% ($231 - $321)     30% ($139 - $196)   20% ($93 - $131)
16-20            50% (344$ - $434)     25% ($172 - $219)   15% ($103 - $132)  10% ($69 - $88)
21-25            45% ($411- $492)      25% ($228 - $276)   15% ($137 - $165)  10% ($91 - $110)   5% ($46 - $55)
26-30            40% ($455 - $527)     22% ($250 - $292)   15% ($171 - $199)  11% ($114 - $133)  8% ($80 - $93)         7% ($68 - $80)
31-35            35% ($477 - $540)     20% ($273 - $311)   14% ($191 - $217)  11% ($109 - $171)  8% ($109 - $124)     7% ($95 - $109)    5% ($68 - $78)


Phaze

  • Sr. Member
  • ****
  • Posts: 346
    • View Profile
Re: Need help putting in our league points
« Reply #1 on: April 11, 2008, 06:46:17 AM »
I think I got it figured, but someone might wanna look it over for mistakes since I just woke up trying to do this... and I'm late for work.... also I have feeling there might be a way to condense this, but I don't know how myself.... anyways, here is what I came up with

IF((n <= 15) && (n >= 11), switch(r, 1, ((n*.5) * .5), 2, ((n*.5) * .3), 3, ((n*.5) * .2)), IF((n <= 20) && (n >= 16), switch(r, 1, ((n*.5) * .5), 2, ((n*.5) * .25), 3, ((n*.5) * .15), 4, ((n*.5) * .1)), IF((n<=25)&&(n>= 21), switch(r, 1, ((n*.5) * .45), 2, ((n*.5) * .25), 3, ((n*.5) * .15), 4, ((n*.5) * .10), 5, ((n*.5) * .05)),  IF((n<=30) && (n>= 26), switch(r, 1, ((n*.5) * .4), 2, ((n*.5) * .22), 3, ((n*.5) * .15), 4, ((n*.5) * .11), 5, ((n*.5) * .08), 6, ((n*.5) * .07)), IF((n<=35) && (n>= 31), switch(r, 1, ((n*.5) * .35), 2, ((n*.5) * .2), 3, ((n*.5) * .14), 4, ((n*.5) * .11), 5, ((n*.5) * .08), 6, ((n*.5) * .07), 7, ((n*.5) * .05))))))) + nh + 1

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6220
    • View Profile
Re: Need help putting in our league points
« Reply #2 on: April 11, 2008, 10:14:10 AM »
Looks right to me, but there is a way to break it down a little bit:

(n * .5 * (IF((n <= 15) && (n >= 11), switch(r, 1, .5, 2, .3, 3, .2)) + IF((n <= 20) && (n >= 16), switch(r, 1, .5, 2, .25, 3, .15, 4, .1)) + IF((n <= 25) && (n >= 21), switch(r, 1, .45, 2, .25, 3, .15, 4, .10, 5, .05)) + IF((n <= 30) && (n >= 26), switch(r, 1, .4, 2, .22, 3, .15, 4, .11, 5, .08, 6, .07)) + IF((n <= 35) && (n >= 31), switch(r, 1, .35, 2, .2, 3, .14, 4, .11, 5, .08, 6, .07, 7, .05)))) + nh + 1

All I did was take the repetitive (n *.5) and take it out of each switch statement.  I also sum the IF statements, since the statements are mutually exclusive (only 1 of the IF statements will match).  This removes the nesting of the IF statements (fewer parentheses).  This isn't necessarily better or more correct, I just find it less confusing.

One thing to note: this formula breaks down if you have less than 11 players or more than 35.  You can remove the lower limit on the first IF statement and/or the upper limit on the last IF statement to fix this...

Phaze

  • Sr. Member
  • ****
  • Posts: 346
    • View Profile
Re: Need help putting in our league points
« Reply #3 on: April 11, 2008, 08:46:54 PM »
HA, I knew there was a better way... verra nice corey... I copy/pasted the n*.5 so wasn't too bad... I saw that problem you mentioned at the end, but I was running late and figured that he knew his tourament better than me so I'll give him what he asks for... glad you brought it up though

Masterdorf

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Need help putting in our league points
« Reply #4 on: April 12, 2008, 02:12:46 AM »
Wow, I am impressed.  I was sick that day in class when the Professor was teaching forumlas.  Thanks you for the fast reply.

Masterdorf

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Need help putting in our league points
« Reply #5 on: April 16, 2008, 05:53:39 PM »
I tried testing the formula. 

I think I missed something the first time around.

Our last tourny we had 24 people.
I thought you it was 50% of the amount of people.  It's 100% of the amount of people entered that create the bonus points to the people that make the money
This is how I figured the points.

Buyin you get 1 point

1 point for each person that you finish ahead of.

Total players was 24.
People that finshed in the money will split the 24 added points
1st 45% of 24 = 10.8
2nd 25% of 24 = 6
3rd 15% of 24 = 3.6
4th 10% of 24 = 2.4
5th 5% of 24 = 1.2

# Award Points
 1 45.00% 33.80
2  25.00% 28.00
 3 15.00% 24.60
 4 10.00% 22.40
 5 5.00% 20.20
 6 points 18.00
 7 points 17.00
 8 points 16.00
 9 points 15.00
 10 points 14.00
 11 points 13.00
 12 points 12.00
 13 points 11.00
 14 points 10.00
 15 points 9.00
 16 points 8.00
 17 points 7.00
 18 points 6.00
 19 points 5.00
 20 points 4.00
 21 points 3.00
 22 points 2.00
 23 points 1.00
 24 points 0.00

« Last Edit: April 16, 2008, 05:56:16 PM by Masterdorf »

Phaze

  • Sr. Member
  • ****
  • Posts: 346
    • View Profile
Re: Need help putting in our league points
« Reply #6 on: April 17, 2008, 06:34:36 AM »
Code: [Select]
(n * (IF((n <= 15) && (n >= 11), switch(r, 1, .5, 2, .3, 3, .2)) + IF((n <= 20) && (n >= 16), switch(r, 1, .5, 2, .25, 3, .15, 4, .1)) + IF((n <= 25) && (n >= 21), switch(r, 1, .45, 2, .25, 3, .15, 4, .10, 5, .05)) + IF((n <= 30) && (n >= 26), switch(r, 1, .4, 2, .22, 3, .15, 4, .11, 5, .08, 6, .07)) + IF((n <= 35) && (n >= 31), switch(r, 1, .35, 2, .2, 3, .14, 4, .11, 5, .08, 6, .07, 7, .05)))) + (n - r) + nh

I make it 100% of the people towards extra point. I also added the general formula n-r and took out the +1 at the end of the code. Now it should work fine for you
« Last Edit: April 17, 2008, 06:45:56 AM by Phaze »

Masterdorf

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Need help putting in our league points
« Reply #7 on: April 17, 2008, 09:10:24 AM »
Thank You Phase.  I added in the nh+1.  everyone gets 1 point to playing. 

Thanks for the help. 


Phaze

  • Sr. Member
  • ****
  • Posts: 346
    • View Profile
Re: Need help putting in our league points
« Reply #8 on: April 17, 2008, 10:53:20 PM »
you bet.... makes my day if I help someone out... happy games