Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Detect and highlight straight flushes in players’s hand with a wildcard? [closed]

$
0
0

Here are the specifics of the problem:

  1. The game starts with two deck of cards and fours players. Each player draws and starts with a 27-card hand. As they play the game, the number of cards in the hand will decrease, until the hand is depleted.

  2. In each game, there are exactly two wildcards that can be played as anything. More specifically, each round a different rank is chosen, and the hearts of that rank are the wildcard. Since we start with two deck of cards, the maximum number of wildcard a player can draw is 2, and minimum is 0.

  3. A straight flush in this game is the traditional 5-card consecutive rank with the same suit combo. For example, if 5 is the chosen rank in a game, then the 5 of hearts are the wildcard, then a the combo of 10, J, Q, A of spades plus a wildcard 5 of heart can be played as a straight flush.

The goal is to find a method to detect whether a straight flush is present in a players hand. And if there is a straight flush, the cards can be highlighted.

I can work out the case where no wildcards are involved. But can’t figure out how to deal with the wildcards.


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>