Questions tagged [poker]

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

poker
Filter by
Sorted by
Tagged with
107 votes
12 answers
25k views

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,...
rook's user avatar
  • 66.7k
40 votes
9 answers
34k views

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, ...
user avatar
38 votes
11 answers
14k views

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 ...
Nick Johnson's user avatar
36 votes
7 answers
43k views

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 ...
snazzer's user avatar
  • 449
34 votes
9 answers
30k views

Building a Texas Hold'em playing AI..from scratch [closed]

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 ...
andandandand's user avatar
  • 22.1k
33 votes
7 answers
47k views

How do I programmatically calculate Poker Odds? [closed]

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. ...
Joel Martinez's user avatar
30 votes
13 answers
91k views

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 ...
Michael's user avatar
  • 41.6k
27 votes
11 answers
4k views

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 ...
Tom Gullen's user avatar
19 votes
5 answers
17k views

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 ...
Fred Fickleberry III's user avatar
19 votes
2 answers
8k views

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 ...
Alex's user avatar
  • 4,957
14 votes
11 answers
1k views

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 ...
Rudiger's user avatar
  • 6,734
13 votes
3 answers
2k views

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 ...
mafu's user avatar
  • 32.2k
11 votes
2 answers
34k views

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

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 ...
Joe's user avatar
  • 4,870
11 votes
3 answers
4k views

Does an open-source poker-related math library exist? [closed]

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 ...
Ben S's user avatar
  • 68.8k
10 votes
5 answers
40k views

working with HUGE lists in python

how can I manage a huge list of 100+ million strings? How can i begin to work with such a huge list? example large list: cards = [ "2s","3s","4s","5s","6s","7s","8s","9s","10s","Js","Qs",...
scott's user avatar
  • 1,429
10 votes
4 answers
2k views

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 ...
user avatar
9 votes
4 answers
5k views

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

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 ...
John Carter's user avatar
  • 6,784
9 votes
3 answers
2k views

Determining winning amount in Poker without creating side-pots

I'm trying to run a poker simulation and have the following data about a poker table how much each player contributed to the pot a "hand score" (after flop) for each player (ie, if player[0].score == ...
Lem0n's user avatar
  • 93
9 votes
1 answer
762 views

php poker generated random results do not match what is expected

I have made a research on poker equities. What I did is use pokerstove program with some selected. And with that program calculated the equities using enumerate all method. So pokerstove results: I ...
Dariux's user avatar
  • 4,153
9 votes
4 answers
4k views

c# check for a poker straight

I am trying to write a poker hand evaluation method in c#. I have managed to do this for every poker hand using linq except a straight. For those that don't play a straight is made up of 5 cards with ...
Charlie Beesley's user avatar
8 votes
4 answers
412 views

Implementing a Dynamic Award System

I have been developing a Online Poker Game. But I keep hitting a wall. I want to implement Awards into the system, but I want them to be dynamic. Meaning I don't want to recompile for every award I ...
Johann du Toit's user avatar
8 votes
5 answers
7k views

Design Pattern: Parsing similar, but differing schemas in text files

thanks in advance for your help. I am wondering if there is a (design) pattern that can be applied to this problem. I am looking to parse, process, and extract out values from text files with ...
JWD's user avatar
  • 12.2k
8 votes
3 answers
7k views

Algorithm to give a value to a 5 card Poker hand

I am developing a poker game as college project and our current assignment is to write an algorithm to score a hand of 5 cards, so that the scores of two hands can be compared to each other to ...
KOB's user avatar
  • 4,255
8 votes
2 answers
7k views

C# Poker Libraries [closed]

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 ...
Jimmy Collins's user avatar
7 votes
10 answers
14k views

Function to determine whether a poker hand is a straight?

For a homework assignment I was given a Card class that has enumerated types for the Rank and Suit. I am required to compare two poker hands (each hand is an ArrayList of 5 cards) and decide the ...
Logan Serman's user avatar
  • 29.7k
7 votes
4 answers
9k views

On Two Plus Two poker hand evaluator, how do you get the best 5 cards combination out of the 7 that you passed to it?

Is it possible to extract that info from the equivalence value? I understand that the higher the equivalence value the better. Category and rank can also be extracted from the equivalence value. But ...
ian's user avatar
  • 1,605
7 votes
2 answers
2k views

Mental Poker Toolkit

Can anyone suggest a toolkit or framework (or maybe an idea) that can be useful to implement secure and cheat-resistant online poker (texas hold'em) client without trusted third party server?
Andrei Petrenko's user avatar
6 votes
4 answers
25k views

Array.reduce on a multidimensional array to array of objects

In my poker app I have an array of hands, each hand being array of randomly selected card objects with value and suit: [ [ { value: 5, suit: 's' }, { value: 4, suit: 's' }, { value: 6, suit: '...
Jackson Lenhart's user avatar
6 votes
5 answers
18k views

Algorithm to determine the winner of a Texas Hold'em Hand

Ok, so I am making a Texas Hold'em AI for my senior project. I've created the gui and betting/dealing procedures, but I have reached the part where I need to determine who won the hand, and I do not ...
ULcajun's user avatar
  • 143
6 votes
3 answers
3k views

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 multiple AI agents against each other in batch mode very quickly, and ...
Wesley Tansey's user avatar
6 votes
1 answer
308 views

Determine Poker Table Positions - Sit'n Go Tournaments

Note: I do the javascript code according to the ajrwhite answer. Hope it helps someone. Link: http://codepen.io/eMineiro/pen/EKrNBe Open codepen console to see the examples working. In ...
Eduardo Arruda Pimentel's user avatar
5 votes
7 answers
3k views

How can I teach a computer system how to play poker? [closed]

At first I have 5 cards by random, of course. Only one time I can change and also l have already taught [the program] the poker rules in my system. My problem is how can I choose "I don't need this ...
tony's user avatar
  • 59
5 votes
11 answers
6k views

Why does my isFullHouse() method also accept a simple three-of-a-kind?

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. ...
LKANL's user avatar
  • 69
5 votes
7 answers
10k views

Poker Hands in Java

Is there any easy method to compare two poker hands? I'm going about this pretty naively, so if anybody has experience doing this, it could be helpful.
Ben B.'s user avatar
  • 3,756
5 votes
3 answers
3k views

Cards representation in Prolog

I'm trying to learn Prolog. This are my first steps with this language. As exercise I want to write program which can recognize some poker hands (Straight flush, Four of a kind, Full house etc.). I'm ...
Adam's user avatar
  • 2,264
5 votes
7 answers
3k views

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 ...
Robusto's user avatar
  • 31.7k
5 votes
3 answers
3k views

Comparing the rank of cards in a hand

I have a homework assignment that was two parts. The first part was to make a program that puts a vector of 52 card objects when you create an object for the class Deck. I did this by making the deck ...
David Bernal's user avatar
5 votes
1 answer
819 views

Porting existing C++ code to R

I would like to port the SpecialK Poker Hand evaluator to R. I think this should be relatively easy using the Rcpp package, but I have no idea where to begin. The existing tutorials seem to focus ...
Zach's user avatar
  • 30k
5 votes
2 answers
3k views

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 ...
Topera's user avatar
  • 12.3k
5 votes
2 answers
3k views

Monte Carlo method for calculating poker equities

I started to learn C language on my own and decided to build a program that calculates poker equities. I'm trying to calculate equity with Monte Carlo, but I get wrong results. So here is an example: ...
deville's user avatar
  • 53
5 votes
3 answers
814 views

Designing a hand history class for Texas Hold'em in Java

I am trying to come up with a Java hand history class for Texas Hold'em and wanted to bounce an idea off here. Requirements are that every action is stored and there is an efficient way to traverse ...
rndapology's user avatar
5 votes
0 answers
73 views

How to create a map of settlement for a game of poker algorithmically containing the least number of transactions? [duplicate]

Poker is a zero-sum game. This means that the amount of money going out of the table is equal to the amount going in. I mentioned poker here because that is what I need the solution for, but the ...
dominikduda's user avatar
4 votes
8 answers
1k views

Commercial-grade randomization for Poker game

I need some advice on how to tackle an algorithmic problem (ie. not programming per se). What follows are my needs and how I tried to meet them. Any comments for improvement would be welcome. Let me ...
Tommy Fisk's user avatar
4 votes
7 answers
3k views

Is Collections.shuffle suitable for a poker algorithm?

there is a poker-system in java, that uses Collections.shuffle() on all available cards before the cards are dealt. So a collection of 52 cards 2-9, J, Q, K, A in 4 types. After that we Collections....
PassionateDeveloper's user avatar
4 votes
4 answers
1k views

Regex to calculate straight poker hand - Using ASCII CODE

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 ...
Topera's user avatar
  • 12.3k
4 votes
7 answers
8k views

Dice Question (Full House and Straight recognition)

I'm making a dice game. There are 5 dice in which I have all the values for and I need to determine if they make up a full house (3 of one and 2 of another), small straight (1-4, 2-6 or 3-6) or a ...
Lloyd Powell's user avatar
  • 18.5k
4 votes
1 answer
3k views

Java library to calculate the equity of texas poker hands

Does anyone know a fast java algorithm\library to calculate the equity or the probability of winning (as the program PokerStove) of texas poker hands?
Webman's user avatar
  • 1,544
4 votes
4 answers
973 views

Parsing in Ruby (on Rails)

I want to write a Rails app to assist me with my online Poker. I play on PokerStars, and there is text data available for each hand that is played. The format it comes in is this: PokerStars Game #...
alamodey's user avatar
  • 14.6k
4 votes
4 answers
3k views

Coding a logical sub pot system for texas holdem poker

Edit It seems like I am getting different responses on how the game actual works, and after reading the official rules, and talking to numerous poker buddies, I guess I don't know the rules myself. ...
User's user avatar
  • 639
4 votes
2 answers
600 views

Can I do better than binary search here?

I want to pick the top "range" of cards based upon a percentage. I have all my possible 2 card hands organized in an array in order of the strength of the hand, like so: AA, KK, AKsuited, QQ, AKoff-...
Joe's user avatar
  • 4,870

1
2 3 4 5
10