ihendley / treys

A pure Python poker hand evaluation library
MIT License
132 stars 55 forks source link

Possible incorrect hand evaluation #6

Open eukrit opened 3 years ago

eukrit commented 3 years ago

Could you have a look at my screenshot? I think the hand evaluation is wrong because that is not supposed to be straight. 2021-01-23_4-04-45

` from card import from evaluator import from deck import *

deck = Deck()

board = deck.draw(5) print(Card.print_pretty_cards(board))

evaluator = Evaluator()

players = [deck.draw(2) for i in range(10)] for i in range(len(players)): handstr = Card.print_pretty_cards(players[i]) evalint = evaluator.evaluate(board, players[i]) ranknum = evaluator.get_rank_class(evalint) rankname = evaluator.class_to_string(ranknum)

  print('Hand: ' + handstr + 'Eval :' + str(evalint) +
        ', Rank No. ' + str(ranknum) + ' [' + rankname + ']')

`

ihendley commented 3 years ago

Hi eukrit, this does look like a straight to me: TJQKA, also known as a broadway straight. I think everything is working as expected.

eukrit commented 3 years ago

Oh yeah your're right! I was confused with T. Sorry ihendley.

eukrit commented 3 years ago

Hi idendley, I think it doesn't work with an empty board. I'm trying to evaluate the player's hand here. (Two Cards)

image

PacPalCent commented 3 years ago

@ihendley Hi! I met an issue with Royal Flash combination. Is it known issue?

Снимок экрана 2021-10-16 в 21 33 21
ihendley commented 2 years ago

Regarding evaluating an empty board - that is not supported. I have removed the comment in the docstring claiming otherwise.

I have also added a Royal Flush hand rank class, so you should see "Royal Flush" instead of "Straight Flush" if you re-run your example on the latest treys.