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
2
votes
2 answers

Periodically updating the game state for all users

I'm working on writing a poker room game in ruby. I'd like to set a time limit on how long each player has to decide what their play is, at the end of which period the game will decide what happens next. (did this particular player time out? did…
dsp_099
  • 5,801
  • 17
  • 72
  • 128
2
votes
1 answer

Determining a poker hand with two arrays

I want to create a simple multiplayer poker program in ruby, but I feel like I'm reinventing the wheel: table = [card1, card2, card3, card4, card5] mike = [card6, card7] john = [card8, card9] card6.face = "A" card6.suit = "spades" I'm having a…
dsp_099
  • 5,801
  • 17
  • 72
  • 128
2
votes
4 answers

Which is more appropriate for static data - final char or enum?

Relating to my Poker Java program would it be a wise decision to choose enum's over chars and ints? As far as I can tell assigning a separate integer value to a char has the benefit of ease of mathematical operators being applied when it comes to…
silverzx
  • 1,209
  • 4
  • 14
  • 18
2
votes
2 answers

Java permutations

I am trying to write a program which can keep track of the number of chips each player has in poker. This is not a poker game, only a program which can keep the number of chips each player has. However, I want to be able to "bet" "call" "fold" etc…
Rhiokai
  • 2,147
  • 5
  • 16
  • 18
2
votes
3 answers

Infinite loop for a pokerhand dealer

I've been trying to make this method for the deck to deal, but once it deals 52 cards it goes onto an infinite loop. I am aware this is because I have it to generate a random number until it gets a card that has not been set, but once all cards are…
user1404664
  • 73
  • 1
  • 2
  • 8
2
votes
1 answer

Cross-compile library (poker-eval) for iOS

I am trying to cross compile the c-library of poker-eval (from http://gna.org/cookbook/?group=pokersource) for iOS, i.e. for use on arm7 architecture. I am following the compile instructions of…
Lenzebo
  • 21
  • 1
1
vote
4 answers

How to operate the poker game by Java?

I’ve learned Java for 1 month. This time, I’d like to create a poker game. There are two questions about my program. I hope somebody can help me to fix it. Each card has it value, for A as 1, king as 10, but I find out that this is a String array.…
Cooky Kao
  • 43
  • 1
  • 2
  • 6
1
vote
2 answers

Video Poker in C++

I'm starting to write a video poker program and I'm running into some issues. I have a Hold function as you can see below: void Game::Hold( bool& choice ) { if( choice == true ) { Console::BackgroundColor(Red); …
Josh Lake
  • 567
  • 1
  • 6
  • 17
1
vote
3 answers

Determine if a function has two pairs

Trying to build a video poker app and I've got most of the winning logic done but I can not wrap my head around two pairs. function isTwoPair() { const tempHand = [...playerHand]; let reduceHand = tempHand.reduce((acc, curVal) => { if…
Mundy
  • 19
  • 5
1
vote
0 answers

How can alter this poker script so that I can pick cards myself?

There's this poker repo: https://github.com/fedden/poker_ai In the README.md file there is a section titled "Playing a game of poker" In this section the author provides a short script to play a round of poker using his repo: from poker_ai import…
Jaime
  • 21
  • 4
1
vote
3 answers

Improving a List Comprehension

The list comprehension below achieves the desired result/output: Each tuple in the list is indexed sequentially The names are grouped together by suit The names are in a consistent order Code (deck of cards toy example): Suits = ["Hearts"]*3…
Cal P
  • 19
  • 1
1
vote
0 answers

How do I logically check for a royal flush in poker?

Code I'm using for card checking def pair(player_hand): for x in range(1,len(player_hand)): if player_hand[x-1][0] == player_hand[x][0]: return True return False def triple(player_hand): for x in range(2, len(player_hand)): if…
Darren Pan
  • 11
  • 1
1
vote
1 answer

Is there an algorithm that calculates the probability of having the best hand in poker?

I have seen implementations for poker evaluators but as far as I understood, those evaluators only find the best hand in a set of cards. I have not been able to find an algorithm that calculates the chance of having the best hand at any point in the…
1
vote
2 answers

Video Poker How to make the combinations?

I have been stuck on this for quite a while. So I thought I'd look it up. But with hours of searching I have come to ask on stack overflow as I am completely stumped. Basically I am making a Web implementation of Jacks or Better: Video Poker. For…
IPSM
  • 71
  • 1
  • 7
1
vote
3 answers

Python: How to compare elements within an array of cards

I am working on a texas hold-em game in python, and am looking to traverse an array containing a complete hand of 7 cards (2 in the hole + 5 on the board). The array contains elements of class Cards, where the Card class constructor is class Card: …