Example #1
0
int main(int argc, char *argv[])
{
    // Setup deck of cards
    CardSet deck;
    for (Rank r = RANK_BEGIN; r != RANK_END; ++r) {
        for (Suit s = SUIT_BEGIN; s != SUIT_END; ++s) {
            Card card(r, s);
            deck.insert(card);
        }
    }

    unsigned long long count = 0;

    // Test each starting hand
    for (CardSet::const_iterator i = deck.begin(); i != deck.end(); ++i) {
        CardSet::const_iterator j = i;
        for (++j; j != deck.end(); ++j) {
            string hole = Card::pairString(*i, *j);
            CardSet test(deck);
            Hand hand;
            test.erase(*i); hand.append(*i);
            test.erase(*j); hand.append(*j);
            count++;
            board(hole, test, hand);
        }
    }

    cout << "TOTAL: " << count << endl;
    printStats();

    return 0;
}
Example #2
0
size_t board_rank(Hand hand, Card flop1, Card flop2, Card flop3) {
    hand.append(flop1);
    hand.append(flop2);
    hand.append(flop3);
    return hand.getRank();
}