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
0
votes
1 answer

Checking if theres two pairs in card hand Python

I am trying to check if there is two pairs in a hand that is random. I have it right now where it'll print one pair so it prints the number of occurrences of that card so if there are 2 twos it'll be 2 x 2 so the first number is the occurrence then…
l.m
  • 131
  • 1
  • 10
0
votes
1 answer

Python probability of a pair

I am trying to make a poker game where it would check if it is a pair or three of a kind or four of a kind. I am trying to figure out where to insert a while loop. if I should put it in front of the for card in set(cards): statement or the for i in…
l.m
  • 131
  • 1
  • 10
0
votes
0 answers

Poker Hand Win Logic doesn't work correctly

Something's wrong with how the winner is determined in my poker game. I've tried checking that the player score value is reset from the loop and that all other logic related variables are too TableCards = [] for Card in Flop: …
0
votes
1 answer

How to check if hand contains one pair of cards in poker game using Mathematica?

In a poker where each player gets 5 cards from a 32 card deck, I am trying to calculate how many subsets contain exactly one pair using Mathematica. I created a deck with four suits and created subsets of all possible combinations of the cards and…
0
votes
1 answer

How to count how many times a number appears in Dice poker, which then determines what ranked hand you have using a list?

I need assistance. I am trying to program a game of Dice poker on python. I have two-thirds completed all of the programmings but have come across a slight hiccup. I have used both Integers and Lists to compute what numbers were rolled and how many…
Raffaele Lioi
  • 11
  • 1
  • 2
0
votes
1 answer

calling function multiple times with new results

I wanted to create a poker simulation that creates a certain number of 5-card poker hands, to see how many times hands I need to play till I get the royal flush... I wrote a function that generates 5 cards but when i run the function multiple times…
KevinK
  • 11
  • 2
0
votes
2 answers

How to redistribute the side pots in poker?

It's a poker game with bluetooth and I encounter some difficulties to redistribute the side pots. Does someone have any experiences with that? for(int k = 0; k < numberOfPlayer; k++) { canWinSidePotUpTo[k]…
DisD
  • 11
  • 4
0
votes
1 answer

How to make if statement to see if the arrays have specific number and characters and returns a boolean value

I am writing a code that finds what cards the user gets. Returns if its a RoyalFlush. I have some code that finds the RoyalFlush but its not working as intended. This is my code; { private Card [] hand; // the hand of 5 cards // the…
sinnnad
  • 9
  • 1
0
votes
2 answers

Implementing Yahtzee in SML

I'm writing an SML Yahtzee/Poker Program that receives a list as an input in the format yahtzee(1,3,3,4,3) in which each number is a result of a dice roll, and then prints the corresponding result, which in this case would be (three-of-a-kind,…
0
votes
2 answers

I'm trying to invoke an object within a method in a different object

Im working on a simple poker game just to improve my OOP experience, i ran into an error that might be beyond my knowledge. The program goes like this, i have a class called Deck() which is of course the deck, a class called player and a class…
0
votes
2 answers

Script efficiency - Poker simulations for statistics

My question is more about logic than coding itself: I am building a python script to simulate poker hands and get statistics from it. My code works very well for assigning and comparing hands, and the only bottleneck for my script is getting the…
0
votes
1 answer

How to implement Aces in 5-Card-Draw game?

I'm taking an online course in Ruby programming and I need to make 5-Card Draw game as one of the projects. It all went well until I realized that Ace can have two values. I've made 3 classes so far: Card, Deck and Hand. I'm currently working on a…
srxco
  • 1
  • 1
0
votes
2 answers

Detect Straight in 7-card poker hand

The following code checks for all straights in a five-card hand (except 5-high, which I add in as an elif) def straight(values,vset): if (max(vset) - min(vset) == 4) and numpair(values) == False and detset(values) == False and quads(values) ==…
Alec
  • 8,529
  • 8
  • 37
  • 63
0
votes
2 answers

simple question on dice poker in python

I'm following along a textbook example of building a dice poker game. Below is a snippet of code I don't quite understand but it does work. So in the while loop under the run method, the second condition is that the wantToPlay method in the…
user637965
0
votes
3 answers

design the structure of a poker game

I noticed that interviewers often ask to design a poker game in either c++ or java. There could be many ways to do that, so I was wondering if anyone could give me a good template answer. Thanks
Bob
  • 10,741
  • 27
  • 89
  • 143