Hi there,
i just noticed your code to check for straight flushes has a glitch
presented by the following sample code, which prints null:
public static void main(String[] args)
{
try
{
Hand h = new HoldemPlayerHand();
h.add(new Card("Ah"));
h.add(new Card("Ks"));
h.add(new Card("Qs"));
h.add(new Card("Js"));
h.add(new Card("Ts"));
h.add(new Card("9s"));
h.add(new Card("2c"));
System.out.println(new
HoldemHandEvaluator().getStraightFlush(h));
}
catch (Exception e)
{
e.printStackTrace();
}
}
it should recognize a King high straight flush, but it doesnt because of
these lines:
public Hand getStraightFlush(Hand hand)
{
RankedPokerHand result = null;
Hand temp = (RankedPokerHand) getStraight(hand);
if (temp != null)
{
temp = (RankedPokerHand) getFlush(temp);
...
here, you get the highest possible Straight of the Hand, which is the
Ace high straight and Check if its flush cards too.
but like in the example its possible that you have and Ace high straight
with 7 cards but also a King high straight flush.
btw: are you still developing pokimon?
regards,
Chris