Questions tagged [poker]

Questions relating to development on the subject of all variants of poker.

Questions in this category contains all aspects of development relating to poker - ie. hand evaluation, game engine, statistics, etc.

464 questions
107
votes
12 answers

Defeating a Poker Bot

There is a new Open Source poker bot called PokerPirate. I am interested in any creative ways in which a web application could detect/thwart/defeat a poker bot. (This is a purely academic discussion, in the same spirit that PokerPirate was…
rook
  • 66,304
  • 38
  • 162
  • 239
40
votes
9 answers

7 Card Poker Hand Evaluator

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
user130076
38
votes
11 answers

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…
Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
36
votes
7 answers

Optimizing Lookups: Dictionary key lookups vs. Array index lookups

I'm writing a 7 card poker hand evaluator as one of my pet projects. While trying to optimize its speed (I like the challenge), I was shocked to find that the performance of Dictionary key lookups was quite slow compared to array index lookups. For…
snazzer
  • 449
  • 1
  • 5
  • 10
34
votes
9 answers

Building a Texas Hold'em playing AI..from scratch

I'm interested in building a Texas Hold 'Em AI engine in Java. This is a long term project, one in which I plan to invest at least two years. I'm still at college, haven't build anything ambitious yet and wanting to tackle a problem that will hold…
andandandand
  • 21,946
  • 60
  • 170
  • 271
33
votes
7 answers

How do I programmatically calculate Poker Odds?

I'm trying to write a simple game/utility to calculate poker odds. I know there's plenty of resources that talk about the formulas to do so, but I guess I'm having trouble translating that to code. Particularly, I'm interested in Texas Hold-em…
Joel Martinez
  • 46,929
  • 26
  • 130
  • 185
29
votes
13 answers

The simplest algorithm for poker hand evaluation

I am thinking about poker hand (5 cards) evaluation in Java. Now I am looking for simplicity and clarity rather than performance and efficiency. I probably can write a "naive" algorithm but it requires a lot of code. I saw also a few poker…
Michael
  • 41,026
  • 70
  • 193
  • 341
27
votes
11 answers

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…
Tom Gullen
  • 61,249
  • 84
  • 283
  • 456
19
votes
5 answers

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…
Fred Fickleberry III
  • 2,439
  • 4
  • 34
  • 50
19
votes
2 answers

Faster poker hand evaluation

I'm trying to use "RayW hand evaluator" approach to get a card combination score (5 best cards out of 7). However I'm having some performance issues with this method. According to sources - using this approach it must be possible to evaluate more…
Alex
  • 4,607
  • 9
  • 61
  • 99
14
votes
11 answers

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…
Rudiger
  • 6,634
  • 9
  • 40
  • 57
13
votes
3 answers

Algorithm to find streets and same kind in a hand

This is actually a Mahjong-based question, but a Romme- or even Poker-based background will also easily suffice to understand. In Mahjong 14 tiles (tiles are like cards in Poker) are arranged to 4 sets and a pair. A street ("123") always uses…
mafu
  • 31,798
  • 42
  • 154
  • 247
11
votes
2 answers

How to loop through all the combinations of e.g. 48 choose 5

Possible Duplicate: How to iteratively generate k elements subsets from a set of size n in java? I want to build my own poker hand evaluator but am having trouble with a particular part. If two players get dealt a two card hand, then there will…
Joe
  • 4,852
  • 10
  • 63
  • 82
11
votes
3 answers

Does an open-source poker-related math library exist?

I would like to develop a poker odds application that can give the probability of various game situations. Since the application will be mostly statistical analysis, I figured I would see if someone else had already written a library that implements…
Ben S
  • 68,394
  • 30
  • 171
  • 212
10
votes
4 answers

NP-Hard? Algorithmic complexity of online poker collusion detection?

What's the best way to describe the algorithmic complexity of collusion detection for a ten-million-player online poker site? Assume (I don't think these assumptions make much difference so feel free to ignore them, but just to clarify): That the…
user2189331
1
2 3
30 31