Question
## Scenario
Implement the core of a three-card poker game. Cards are dealt to seated players one card at a time over three passes, then every hand is ranked and the winner or winners are returned.
Ranks increase from `2` through `A`. A deck contains one card for every rank and suit combination, and a card may be dealt at most once.
## Assumed interface
The exact public API is intentionally flexible. One coherent option is:
```python
@dataclass(frozen=True)
class Card:
rank: str
suit: str
def deal(players: list[str], deck: list[Card]) -> dict[str, list[Card]]: ...
def rank_hand(hand: list[Card]) -> tuple: ...
def winners(hands: dict[str, list[Card]]) -> list[str]: ...
```
State any alternative interface before implementation.
## Part 1: deal and basic ranking
- Deal exactly three cards to each player in seat order, one card per player per pass.
- Reject an insufficient deck and duplicate cards.
- Ignore suits for the first part.
- Rank categories in this order: three of a kind, pair, high card.
- Within three of a kind, compare the repeated rank.
- Within a pair, compare the pair rank and then the remaining kicker.
- For high card, compare ranks from highest to lowest.
- Return all tied winners in original seat order.
## Part 2: add flushes
A flush is three cards of the same suit. The new category order is:
1. three of a kind
2. flush
3. pair
4. high card
Flushes are compared by their ranks from highest to lowest.
## Follow-ups
1. Split dealing from comparison behind a stateful game object and emit an append-only event for every dealt card and declared result.
2. Make a game replayable from its event history.
3. Support deterministic shuffling from a seed for tests while using a secure shuffle in production.
4. Add more three-card categories, such as straights and straight flushes, without scattering category precedence throughout the code.