❤ Hearts ❤
In this assignment, you'll be using the more advanced concepts you've learned to build another text-based game, of the popular card game Hearts. More precisely, we will use rules of the variant called Black Lady, but we will use the name "Hearts" for simplicity.
In Hearts, players avoid certain cards and try to have the lowest score by the time one player eventually reaches 100.
It is usually played with 4 players, but many versions works with 3-5 (including ours).
You can learn the game using the online versions, like this one. The complete version of this assignment will follow almost the same rules as the one linked.
Be sure you are familiar with the game before getting started.
You will code the full set of rules, one part at a time, in the tasks.
One round of hearts (assuming 4 players)
Start a new deck (52 cards).
Deal 13 cards to each player.
Each player picks 3 cards to pass off to another player.
Players play all 13 tricks:
The player who has the Two of Clubs starts the leads the first trick by playing that card.
The winner of a trick scores all points from that trick, and leads the next trick.
There are 26 points in the deck:
Each card of the Hearts suit is worth 1 point.
The Queen of Spade is worth 13 points.
Rounds repeat until someone reaches a target score limit (usually 100 points), after which the player with the lowest score wins. If there are multiple players with the lowest score, rounds continue until a winner is decided.
Players attempt to minimise the number of points they score by avoiding winning tricks.
Special case:
If one player wins all 26 points within a round, they receive 0 points, while all others receive 26 (this is known as "Shooting the Moon")