Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > Tournament Poker > One-table Tournaments
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-30-2005, 10:38 PM
hummusx hummusx is offline
Senior Member
 
Join Date: Jul 2004
Posts: 104
Default Quick math question

I'm trying to finish up a new hand converter (since the old one is broken and there's no indication it'll be fixed soon). My brain is a little fried so I need this bit of math solved for me: if you know your seat number, and you know what number the button is, what's the formula to get my position for this hand? I know it's got to be simple, but for some reason it's all just fuzzy tonight.
Reply With Quote
  #2  
Old 04-30-2005, 10:49 PM
Nottom Nottom is offline
Senior Member
 
Join Date: Feb 2003
Location: Hokie Country
Posts: 4,030
Default Re: Quick math question

well its not super easy since its a function of how many players are left and where they are sitting.
Reply With Quote
  #3  
Old 04-30-2005, 10:51 PM
BradleyT BradleyT is offline
Senior Member
 
Join Date: Dec 2003
Location: Milwaukee
Posts: 512
Default Re: Quick math question

You have to parse the text after the words "dealt to" and replace that with the word HERO.
Reply With Quote
  #4  
Old 04-30-2005, 10:53 PM
BradleyT BradleyT is offline
Senior Member
 
Join Date: Dec 2003
Location: Milwaukee
Posts: 512
Default Re: Quick math question

To get position, put each seat into an array list. Look for the text seat X is the button and use that for your 0 index.

Better brush up on your regular expressions [img]/images/graemlins/smile.gif[/img]
Reply With Quote
  #5  
Old 04-30-2005, 10:58 PM
hummusx hummusx is offline
Senior Member
 
Join Date: Jul 2004
Posts: 104
Default Re: Quick math question

Yeah, I can go through an number them. Yes I can parse out the data. But I really think there should be a calculation that'll just let me get one of the positions directly. Modulus will do the 'around the corner' math. It should work. I want to solve it in a single line.

I'm looking for the elegant way, not the easiest way.
Reply With Quote
  #6  
Old 04-30-2005, 11:02 PM
hummusx hummusx is offline
Senior Member
 
Join Date: Jul 2004
Posts: 104
Default Re: Quick math question

[ QUOTE ]
Better brush up on your regular expressions [img]/images/graemlins/smile.gif[/img]

[/ QUOTE ]

I'm actually pretty handly with regular expressions. I've done a few screen scraping applications in the past so I've had a lot of practice. All of the hand reading stuff is done, I'm just trying to format it for output.
Reply With Quote
  #7  
Old 05-01-2005, 12:00 PM
hummusx hummusx is offline
Senior Member
 
Join Date: Jul 2004
Posts: 104
Default Re: Quick math question

*bump*

Someone...
Reply With Quote
  #8  
Old 05-01-2005, 12:10 PM
hummusx hummusx is offline
Senior Member
 
Join Date: Jul 2004
Posts: 104
Default Re: Quick math question

Ok I knew it was just a fuzzy head at night thing. The formula for figuring out your position is:

(Seat number - button seat number - 2) modulus (player count)
Reply With Quote
  #9  
Old 05-01-2005, 12:30 PM
hummusx hummusx is offline
Senior Member
 
Join Date: Jul 2004
Posts: 104
Default Re: Quick math question

Oh yeah, you need to get an absolute value before you mod it. Some modulus operators automatically do this (I've always thought of the modulus as being a non-negative value), but in some cases you have to do it yourself.

Now I have another question. In what order to positions get named? In other words, if you have 4 people left, is it UTG, Button, SB, and BB? What about 5, 7, 9? Need help on this please.
Reply With Quote
  #10  
Old 05-01-2005, 12:40 PM
Nottom Nottom is offline
Senior Member
 
Join Date: Feb 2003
Location: Hokie Country
Posts: 4,030
Default Re: Quick math question

[ QUOTE ]
Oh yeah, you need to get an absolute value before you mod it. Some modulus operators automatically do this (I've always thought of the modulus as being a non-negative value), but in some cases you have to do it yourself.

[/ QUOTE ]

the mod operator should never return a negative value. not saying they don'e but they shouldn't.

I really think you are probably better off just assigning the seats manually, because none of it really works otherwise unless the players are sitting in consecutive seats.

My thoughts would be to start at the button. And go backwards from there.

i.e. if the button is seat 6. Then assign that player the button. Then assign the BB and count back to find the SB if there is one. Then count backwards from the button assigning any unassigned players a seat in backwards order ... CO, MP3, MP2, ..., UTG

Of course there is probably an easier way.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.