Author Topic: check my formula pleeeeaaassse  (Read 2277 times)

badbeat feva

  • Newbie
  • *
  • Posts: 6
    • View Profile
check my formula pleeeeaaassse
« on: January 28, 2009, 04:24:28 AM »
Hi ive been reading the forums trying to figure out my formula and im pretty close....dummy at this programming so desperatly need help if possible.
 
if(inLeague, (leagueRank < 37, 25, 0) + if(leagueRank < 31, 50, 0) + if(leagueRank < 25, 25, 0) + if(leagueRank < 19, 25, 0) + if(leagueRank < 13, 50, 0) + if(leaguerank < 7, 50, 0) + if(leagueRank < 6, 50, 0) + if(leagueRank < 5, 50, 0) + if(leagueRank = 3, 100, 0) + if(leaguerank = 2, 250, 0) + if(leagueRank = 1, 450, 0))

 if I  change a players membership status of player, the top points (750) will be awarded according to the 1st place member of a league, (we play with non league members also) exactly what I want, EXCEpt : it only works from ranking 2 thru X (doesnt matter how many ppl play). 1st ranked player only gets 300 if i make him a league member, but any other ranking gets correct points.   eg...... after I save tourney, I remove all players from the league. Any player that I chose to be back in the league (as long as he was playing that game) and hes ranked 2 through say 24, the 750 will be awarded correctly. If I make the 1rst ranked player a league member, he only gets 300. Im assuming that theres a better shorter formula, but hey this is tough stuff for me...lol and there are some very clever ppl on this forum...great software ....thanks in advance

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5420
    • View Profile
Re: check my formula pleeeeaaassse
« Reply #1 on: January 28, 2009, 11:53:30 AM »
It's a bug.  To work around this, add this to your formula:

assign("leagueRank", leagueRank + 1)

So your whole formula will be:

assign("leagueRank", leagueRank + 1)
if(inLeague, (leagueRank < 37, 25, 0) + if(leagueRank < 31, 50, 0) + if(leagueRank < 25, 25, 0) + if(leagueRank < 19, 25, 0) + if(leagueRank < 13, 50, 0) + if(leagueRank < 7, 50, 0) + if(leagueRank < 6, 50, 0) + if(leagueRank < 5, 50, 0) + if(leagueRank = 3, 100, 0) + if(leagueRank = 2, 250, 0) + if(leagueRank = 1, 450, 0))


I'll fix this for 2.5.6.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5420
    • View Profile
Re: check my formula pleeeeaaassse
« Reply #2 on: January 28, 2009, 12:31:43 PM »
Note that after this is fixed, you'll need to remove my addition from your formula.

badbeat feva

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: check my formula pleeeeaaassse
« Reply #3 on: January 28, 2009, 02:43:32 PM »
Thank you soooo much for your help Cory, very much appreciated, I own the tables, chips, laptop and run the tourneys. All the players (new ones coming steadily) absolutely love the format and the professionalism that this software provides. The moving of players, stats, clocks, blinds, breaks, etc makes for no argument and my job easier. I am still sooo close, and once solved I can get on with starting the new league:  this is what is happening:

Copy and pasted new formula, if I remove all players from league again and add : 1st rank to league he gets the 750.…2nd 550.…etc, works great, however if I remove rank 1 from league the 750 disappears but rest of points stay in order of rank 2nd place down,…….if I remove the 2nd rank simultaneously, the 550 goes to the next league member down the line, and that works just fine……so its just that 1st rank with the problem.
 I will know in advance how many and who are going to be league members as they have to prepay before season starts, so I don’t think that I’ll be adding or removing players mid season…..it might be ok this way. We will be dropping our worst 3 scores from 12 tourneys, so we might add a latecomer or 2 since they theoretically have 3 freebees, that’s why I may add a member after season started. However I don’t have to, so like I say I might be able to get around this.

badbeat feva

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: check my formula pleeeeaaassse
« Reply #4 on: January 28, 2009, 06:31:12 PM »
Ive ran 5 dummy games and if non league member finishes 1st I have to manually change the points for league members, because the 750 top points disappears....... seems to work fine using any other combination of placings for league and non league players. Thanks again

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5420
    • View Profile
Re: check my formula pleeeeaaassse
« Reply #5 on: January 29, 2009, 09:48:41 AM »
I'm confused.  The addition to your formula didn't help?  I tried it with many combinations and it worked fine.

The problem is that each player is getting a leagueRank of one less than they should.  So, the player who should have a leagueRank of 3 gets a leagueRank of 2.  The player who should have a leagueRank of 2 gets a leagueRank of 1.  And the player who should have a leagueRank of 1 gets a leagueRank of 0.  Any players NOT in the league also get a leagueRank of 0.  So, to your formula, it appears as though 3rd place gets 2nd, 2nd place gets 1st, and 1st place gets nothing (as far as points calculated using the leagueRank).  By incrementing the leagueRank variable, everything is back to correct.  The exception is that all players who are NOT in the league had a leagueRank of 0 and now have a leagueRank of 1.  However, you're filtering out non-league players by using the if(inLeague, ...) function, so it doesn't matter that non-league players now have a leagueRank of 1 - it's never taken into consideration for non-league players.

badbeat feva

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: check my formula pleeeeaaassse
« Reply #6 on: January 29, 2009, 11:23:26 PM »
Hi thanks for the reply. I added addition to formula then picked 6 players to be league members, a few to be non members, and ran 5 dummy games. As long as the player who ranked 1st was a league member everything was fine. If a non leaguer finished first then no 750 for first was present, just 2nd thru the rest, all in the correct order and placements. If a league member finished 1st and non leaguer was 2nd, then 1st ranked leaguer got 750, nothing for 2nd, and 3rd place leaguer got 2nd place points,(which is correct) and all the other placements and points distributions are all correct. Yesssssss thats perfect.

With the addition to the formula, and after I save a game, if I remove the first ranked player from the league then the 750 points ( in that game) disappears leaving only 2nd rank points  thru the rest correctly in order. What was happening before the addition to the formula was that the 1st rank player got 300 points NOT 750, but 2nd thru the rest received 550 down in the correct order and placement.
           eg......(before addition to formula) Bryce (league member) was winner of tourney and received only 300 points, 2nd was 550, etc (and rest of the points were distributed correctly thru rankings).....with addition to formula:  Bryce (league member) receives  750 and 2nd thru the rest all receive correct amount. However if I remove Bryce from league then the 750 points for 1st disappears and the next league member now should receive the 750,  but receives only the 2nd place 550 points (not first 750) and the rest are distributed correctly from 2nd down So its still just a problem with 1st ranked non leaguer, so all I have to do is manually change the points in that one situation.....no biggie and I hope that all this makes sense to you

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5420
    • View Profile
Re: check my formula pleeeeaaassse
« Reply #7 on: January 30, 2009, 11:45:24 AM »
Ug, you're right.  I see now there isn't a way to work around this using the formula.

If the first place finisher is in the league, then everyone's leagueRank is off by one (1 becomes 0, 2 becomes 1, etc).

If the first place finisher is NOT in the league, then all league players have a correct leagueRank value.

I guess you'll just have to be aware of this until I can get 2.5.6 out (hopefully very soon).

So, if in your tournament the first place finisher is not in the league, your formula will work.  If the first place finisher IS in the league, add

assign("leagueRank", leagueRank + 1)

to the formula.

badbeat feva

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: check my formula pleeeeaaassse
« Reply #8 on: January 30, 2009, 06:26:15 PM »
thanks again for your help....I just gotta say one more time, great software and great timely support. Im more of a point and click kinda pc user so Im not great at programming. Thanks again ....little ol me from a little ol town in big ol Canada.