treys icon indicating copy to clipboard operation
treys copied to clipboard

Possible incorrect hand evaluation

Open eukrit opened this issue 5 years ago • 5 comments

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 + ']')

`

eukrit avatar Jan 22 '21 21:01 eukrit

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

ihendley avatar Jan 22 '21 21:01 ihendley

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

eukrit avatar Jan 23 '21 07:01 eukrit

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

eukrit avatar Jan 23 '21 18:01 eukrit

@ihendley Hi! I met an issue with Royal Flash combination. Is it known issue? Снимок экрана 2021-10-16 в 21 33 21

PacPalCent avatar Oct 16 '21 18:10 PacPalCent

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.

ihendley avatar May 04 '22 07:05 ihendley