poker

Need help iteratating over an array, retrieve two possibilites, no repeats, for Poker AI

I can't really think of a good way to word this question, nor a good title, and maybe the answer is so ridiculously simple that I am missing it. I am working on a poker AI, and I want to calculate the number of hands that exist which are better than mine. I understand how to that, but what I can't figure out is the best way to iterate ...

7 Card Poker Hand Evaluator

Hey, Does anyone know a fast algorithm for evaluating 7 card poker hands? Something which is more efficient than simply brute-force checking a every 21 5-card combination of hands from a set of 7. Cheers, Pete ...

Need feedback on two member functions of a Table class in C++

int Table::addPlayer(Player const& player, int position) { if (position > 0 || position < 11) { deque<Player>::iterator it = playerList.begin()+position; deque<Player>::iterator itStart = playerList.begin()+postion; while(*it != "(empty seat)") { it++; if (it == playerList.end()) { ...

Getting information from a text box - Full Tilt Poker.

Full Tilt Poker's GUI has a box of text that keeps reporting on the state the current hand. I wanted to be able to parse that text but do not know how to gain access to it, so if anyone could point me in the proper direction, I would appreciate it greatly. Image with the GUI and text box: http://img143.imageshack.us/img143/6660/ftpbox.j...

Which is faster — sorting or multiplying a small array of elements?

Reading through Cactus Kev's Poker Hand Evaluator, I noticed the following statements: At first, I thought that I could always simply sort the hand first before passing it to the evaluator; but sorting takes time, and I didn't want to waste any CPU cycles sorting hands. I needed a method that didn't care what order the five cards were g...

IComparable and OrderBy. Trying to sort Poker hands with C#.

Hello All, I am attempting to create a simple program that analyzes the poker hands. Given n hands/players and the community cards (Texas hold 'em) I would like to determine the winner(s). However, my test is failing when I have two exact results - it only returns one winner. i.e The hand result contains J J 9 9 K, for both players, but...

Regex to calculate straight poker hand?

Is there a regex to calculate straight poker hand? I'm using strings to represent the sorted cards, like: AAAAK#sssss = 4 aces and a king, all of spades. A2345#ddddd = straight flush, all of diamonds. In Java, I'm using these regexes: regexPair = Pattern.compile(".*(\\w)\\1.*#.*"); regexTwoPair = Pattern.compile(".*(\\w)\\1.*(\\w)\\...

Regex to calculate straight poker hand - Using ASCII CODE

Hi, In another question I learned how to calculate straight poker hand using regex (here). Now, by curiosity, the question is: can I use regex to calculate the same thing, using ASCII CODE? Something like: regex: [C][C+1][C+2][C+3][C+4], being C the ASCII CODE (or like this) Matches: 45678, 23456 Doesn't matches: 45679 or 23459 (no...

A Better C# Poker Framework Design?

I'm writing a poker framework in C# and I don't like the design I currently have. My goal is to have a game engine that can play a multiple AI against each other in batch mode very quickly, play multiple AI vs. multiple humans (probably via a Silverlight client). I'd like to keep efficiency high but maintain game support flexibility-- e....

preg_replace multiple instances on 1 line?

I have text like this from poker software (I have highlighted the parts I need to replace). --- FLOP --- [Jh 9h Ah] driverseati checks darrington has 15 seconds left to act darrington bets 100 InvisibleEnigma calls 100 driverseati folds --- TURN --- [Jh 9h Ah] [3c] darrington bets 200 InvisibleEnigma calls 200 --- R...

Detecting an online poker cheat

It recently emerged on a large poker site that some players were possibly able to see all opponents cards as they played through exploiting a security vulnerability that was discovered. A naïve cheater would win at an incredibly fast rate, and these cheats are caught very quickly usually, and if not caught quickly they are easy to detec...

Looking for Hold'em algorithms (not hand evaluation)

I'm working on an app which is intended to give the % chance of landing specific poker hands in a Texas Hold'em game. The idea is to select any of 0-7 cards and then calculate what your chances are of completing each of 1P,2P,3K,S,F,FH,4K,SF. I am, in particular, not attempting to compare two hands nor determining your chances of winnin...

Generating all 5 card poker hands

This problem sounds simple at first glance, but turns out to be a lot more complicated than it seems. It's got me stumped for the moment. There are 52c5 = 2,598,960 ways to choose 5 cards from a 52 card deck. However, since suits are interchangeable in poker, many of these are equivalent - the hand 2H 2C 3H 3S 4D is equivalent to 2D 2S ...

Poker program: Problems with isFullHouse method!

I am having problems with my full house method. I thought it was as simple as checking for three of a kind and a pair. But with my current code i am getting a full house with only a three of a kind. Code for isFullHouse() isThreeOfAKind() and isPair() is below thanks for all the help! public boolean isPair() { Pips[] values = new ...

How can I print all possible "full houses" in poker with Java?

I was wondering if anyone knew how to implement the code in java to print all cases of full house. There are roughly 3700 different cases. So far i'm around 2700 but I am having trouble changing the suits, her is what I have so far. public class FullHouseTest {// static int count = 1; static int [] cards ={1,2,3,4,5,6,7,8,9,10,11,12,13...

poker hand history analyzer

I want to build a poker hand history analyzer that will work on both windows and osx for the desktop. The user needs to be able to select a set of text files that are parsed into a database on their local machine. Then the data in the database is displayed with various filter options, info tables and graphs. What are my options for pr...

Is there a simpler way than this to calculate a straight in poker?

I have an algorithm for calculating whether a player's hand holds a straight in Texas Hold'em. It works fine, but I wonder if there is a simpler way to do it that does not involve array/string conversions, etc. Here's a simplified version of what I have. Say the player is dealt a hand that is a 52-element array of card values: var rawH...

How exactly does sharkscope or PTR data mine all those hands?

I'm very curious to know how this process works. These sites (http://www.sharkscope.com and http://www.pokertableratings.com) data mine thousands of hands per day from secure poker networks, such as PokerStars and Full Tilt. Do they have a farm of servers running applications that open hundreds of tables (windows) and then somehow spide...

Algorithms for testing a poker hand for a straight draw (4 to a straight)?

Hi Folks, I'm in the throes of writing a poker evaluation library for fun and am looking to add the ability to test for draws (open ended, gutshot) for a given set of cards. Just wondering what the "state of the art" is for this? I'm trying to keep my memory footprint reasonable, so the idea of using a look up table doesn't sit well b...

C# Poker Libraries

Hi, I'm building a simple poker website for a demo. Anyone know where I can find a set of classes encapsulating card, deck, hand etc. ? Google is not being very helpful, (most links are to codeproject which is down until 1pm EST - I'm in Ireland). Thanks! ...