Open Side Menu Go to the Top
Register
In Search of Free Poker Libraries for Developers In Search of Free Poker Libraries for Developers

10-29-2008 , 07:32 PM
Anyone know if there are any free poker libraries out there that can do the following:

convert two poker cards into a hand classification, e.g.: feed into the function AsQh and it will return AQo

give you the strength of your hand, e.g. feed into the function your hole cards and the board (AsQs) (2s 3s 8c) and return "flush draw with two overs"
In Search of Free Poker Libraries for Developers Quote
10-29-2008 , 09:45 PM
Quote:
Originally Posted by Stark
convert two poker cards into a hand classification, e.g.: feed into the function AsQh and it will return AQo
If you can't do that one yourself I don't see how you are going to be able to code anything anyways.

output first character = input first character
output second character = input 3rd character
If second character = 4th character output 3rd character = s
else output 3rd character = o

Quote:
give you the strength of your hand, e.g. feed into the function your hole cards and the board (AsQs) (2s 3s 8c) and return "flush draw with two overs"
This takes a little more work but is a fun exercise that will teach you a lot about coding and problem solving.

~Jess
In Search of Free Poker Libraries for Developers Quote
10-29-2008 , 10:19 PM
out of sheer boredom (and while i should be working on my own work) i threw this together in php (impractical? yes.) for the first part:
Code:
<?
$holecards = "AhQh";
$flop = "3s5h9h";

//analyze hole cards
if (strlen($holecards) == 4) {
list($card1,$suit1,$card2,$suit2) = str_split($holecards);
$suited = ($suit1 == $suit2) ? "s" : "o";
echo $card1 . $card2 . $suited;
}

else {
echo "error with the string";
}
?>
untested but was a good distraction lol
In Search of Free Poker Libraries for Developers Quote
10-30-2008 , 09:07 AM
This may help.
http://spaz.ca/poker/
In Search of Free Poker Libraries for Developers Quote
10-30-2008 , 09:58 AM
Quote:
Originally Posted by Mr Flibble
This may help.
http://spaz.ca/poker/
sweet, thanks Mr Flibble, C# code too which is what i'm working with.

From this I can do the rest, but perhaps someone else has been working on this as well or there is already a library for this too:

function to evaluate board "texture"
e.g.:
int GetBoardTexture("As 2s 9c")
{
return AceHigh & FlushDraw & GutShotStraightDraws
}

function to get possible hands that fall in to certain "HandType":
e.g.:
hand[] GetPossibleHands(Board="As 2s 9c", HandType=GutShotStraightDraws)
{
return hand[] {35o, 35s, 45o, 45s, etc..}
}

function to get HandDraws
e.g.:
int GetHandDraws(Hand="QsJs", Board="Ts9s2h")
{
return OneOverCardThatCompletesPossibleStraight & OneOverCardThatCompletesPossibleGutShotStraight & NutStraightDraw & NonNutFlushDraw & NutStraightFlushDraw
}
In Search of Free Poker Libraries for Developers Quote
10-30-2008 , 10:02 AM
What are you making?
In Search of Free Poker Libraries for Developers Quote
10-30-2008 , 11:45 AM
Quote:
Originally Posted by Mr Flibble
What are you making?
I'm working on a better/more in-depth PokerTracker / HoldemManger.

I have most of the hand parsing done, and I'm working on evaluating the hand and inserting into the database. I want to be able to track board textures / hand strength / relative hand strength so I can have something like this in the HUD (ultimate end-goal):

Villain:
VPIP, PFR, 3-bet, etc.. (standard stuff)
3-bets preflop: AA, KK, QQ
All-In preflop: AA,KK,AKs
All-In on Flop: Sets, FlushDraw, Straight Draws, Overs with GutShot
Known C-bets: OverCards, TPTK, Underpair
C-Bet(%) FlopTextures: AceHighFlop (100%), StraightFlushDraw (10%), KHighFlop(100%), QHighFlop(60%)
Checks Flop with: Sets, NutFlush, NutStraight, TPTKNoDrawBoard
etc...

Also by tracking all that stuff in the database, I can evaluate my play in intricate detail. I can determine which boards have cost me a lot of money when I've c-bet or if I'm throwing away too much money on turned flushes or flopped flushes, etc...

I don't know how much of this is feasible, but I'm making the app have the potential for this from the start
In Search of Free Poker Libraries for Developers Quote
10-30-2008 , 01:13 PM
Ah. Good luck with it.
In Search of Free Poker Libraries for Developers Quote
10-30-2008 , 07:56 PM
That's quite the task. There's a lot of information there to sort through and track, I could see the HUD getting quite large.
In Search of Free Poker Libraries for Developers Quote

      
m