Would you be receptive to using other peoples’’ code?
poker game
That’s the goal. Ok I will come up with a code for you to classify the hand types. You can use it, or not. Give me a day.
It's about as simple as it gets. The code repository, so far, is at https://github.com/sjhalayka/poker/blob/main/main.cpp
I will post tomorrow when it's complete.
I won't post the whole code, but do you understand what this code does:
bool is_flush(const vector<card>& sorted_hand)
{
map<short unsigned int, size_t> suit_counts;
for (size_t i = 0; i < NUM_CARDS_PER_HAND; i++)
suit_counts[sorted_hand[i].suit]++;
if (suit_counts.size() == 1 && suit_counts[0] == NUM_CARDS_PER_HAND)
return true;
return false;
}
Advertisement
Popular Topics
Advertisement