Author Topic: Formula Help for a league  (Read 2491 times)

Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Formula Help for a league
« on: September 11, 2007, 12:42:48 PM »
Hi, im currently attempting to make a formula based on the number of people in the game.

if should be like this, first place gets n so the number of people, every place (up to place 10) after that gets the number of players - 2 times the rank

So far i've got to here
Quote
switch(r, 1, n, 2, n - 2r, 3, if(n >= 6, n-2r, 0), 4, if(n >= 8, n-2r, 0), 5, if(n >= 10, n-2r, 0), 6, if(n >= 12, n-2r, 0), 7, if(n >= 14, n-2r, 0), 8, if(n >= 16, n-2r, 0), 9, if(n >= 18, n-2r, 0), 10, if(n >= 20, n-2r, 0))

It also checks to see if there are the correct number of people in there so that minus points arent given.

However its currently saying Formula Error, wondering if you could help

Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help for a league
« Reply #1 on: September 11, 2007, 12:50:30 PM »
also, is it possible for a dynamic league, so using the points screen above, but rather than accumulate the points for a league it averages out, this way people who play a ton more games don't get a huge advantage over others (but they have to play a minimum number of games)

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Formula Help for a league
« Reply #2 on: September 11, 2007, 01:42:34 PM »
Well, the first problem is that "2r" isn't a number, which the TD will attempt to interpret it as.  You need to insert a * (multiplication) in there, so all of your "2r" instances are "2 * r".

Code: [Select]
switch(r, 1, n,
  2, n - 2*r,
  3, if(n >= 6, n-2*r, 0),
  4, if(n >= 8, n-2*r, 0),
  5, if(n >= 10, n-2*r, 0),
  6, if(n >= 12, n-2*r, 0),
  7, if(n >= 14, n-2*r, 0),
  8, if(n >= 16, n-2*r, 0),
  9, if(n >= 18, n-2*r, 0),
  10, if(n >= 20, n-2*r, 0))

(linefeeds added for legibility)

That gets it working.  But you can also trim it down just a bit:

Code: [Select]
max(switch(r, 1, n, n-r*2), 0)

To average points over time, edit the Filter on the Stats tab:
- set the Tournament Score formula to "points"
- set the Overall Score formula to "average(score)"

When you run the stats (Refresh Tourneys), each player will then have an Overall Score that is the average number of points they earned per tournament.


Morphius

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Formula Help for a league
« Reply #3 on: September 11, 2007, 01:55:05 PM »
Thanks your amazing corey keep it up :)