I added this method to HandEval as I found it useful for debugging.
public static Set<Card> decode(long encodedCards) {
Set<Card> cards = new HashSet<Card>();
for (int i = 0; i < 52; i++) {
if (((encodedCards >>> i) & 1) == 1) {
cards.add(Card.valueOf(Rank.values()[i % 13].name()
+ "_" + Suit.values()[i / 13].name()));
}
}
return cards;
}
Original issue reported on code.google.com by mistert...@yahoo.com on 11 Apr 2009 at 6:24
Original issue reported on code.google.com by
mistert...@yahoo.com
on 11 Apr 2009 at 6:24