Hooray for references!!
Perl is so maintainable!!
King of the Hill
King of the Hill is a 5-player variant of the point-based trick-taking card game "Eighty Points" that pits the "king of the hill" (KotH) and his/her teammate (the defenders) against the other 3 players (the challengers). However, the challenging and defending teams often change from round to round, and each player is trying to increase his or her individual score, regardless of which team they're on. The game's fluid partnerships combine bluffing and reading hand strength from poker with trick-taking strategy.
The game requires two 54-card decks (each containing one red joker and one black joker). A piece of paper to keep track of player ranks is recommended. Each player starts at rank 2 and promotes to ranks 3, 4, 5, ..., 10, Jack, Queen, King, and Ace. After each round, the challenging team's score is tallied to determine whether either team's members will be promoted (see the Scoring section).
There are two phases to each round of play: drawing cards and playing tricks.
The game ends after a player is promoted from rank Ace. If multiple players at rank Ace are promoted in the same round, then they remain at rank Ace and gain bonus ranks (Ace+1, Ace+2, etc.) until there is only a single player with the highest rank at the end of a round. Alternatively, the game can be played for a fixed number of rounds, or the game could end after a player has passed an earlier rank (e.g. the game could end after a player is promoted from rank 10).
The drawing phase begins once the two decks of cards (including one red joker and one black joker in each deck) has been shuffled and placed in a stack within reach of all players. The player to the right of the KotH of the current round cuts the shuffled stack, and players draw cards one at a time into their hand, proceeding counter-clockwise, until there are eight cards left in the stack (thus each player will draw 20 cards), at which point the drawing phase ends.
The purpose of the drawing phase is to determine the "trump suit" (all cards of the trump suit are trump cards), as the "trump rank" is determined by the rank of the KotH (e.g. if the KotH has rank Jack, then Jacks of any suit are trumps cards in that round). While drawing cards, players may look at their cards; if any player draws a card with the trump rank (following the example above, if any player draws a Jack), then that player can "declare" the trump suit by placing that card face up for all players to see (the declared trump suit would be the suit of the face-up card). If another player has a pair of identical (i.e. same suit and rank) cards of the trump rank, they can override the trump suit by placing that pair of cards face up, changing the trump suit to the suit of the pair of face-up cards. If no trump suit is declared when players have finished drawing cards (quite rare), then the KotH can verbally choose any one of the four suits to be the trump suit, and this declaration cannot be challenged.
The playing phase begins with the KotH drawing the eight remaining cards into his or her hand. The KotH must place any of the eight cards now in his/her hand face-down as "dead cards," which should be kept separate from the discarded cards during the hands of the round and should not be shown to any other players. Once the eight dead cards have been placed, the KotH must call for a teammate by calling the suit and rank of a non-trump card (e.g. "King of Clubs" or "Ace of Diamonds"). This "called card" determines which of the four remaining players will be the KotH's teammate; the first player to play the called card is the KotH's teammate, which makes the remaining three players the challengers. Once all players acknowledge the called card and trump suit and rank, the KotH can lead off the first trick, with play proceeding to the right (counter-clockwise).
For the rest of the round, the strengths of the cards are, from strongest to weakest:
- Red Jokers
- Black Jokers
- Cards that have the trump suit and trump rank
- Cards that have the trump rank but not the trump suit
- Cards that have the trump suit but not the trump rank, with Ace being the strongest, and 2 being the weakest (assuming that 2 isn't the trump rank)
- Cards that don't have the trump suit or the trump rank, with Ace being the strongest, and 2 being the weakest (again, assuming that 2 isn't the trump rank)
Note that when comparing two cards with equal standing (e.g. any two identical cards or any cards that have the trump rank but not the trump suit), the card played earlier in the trick is favored. The winner of the trick takes all of the cards that are worth points in the trick (if the defending team wins the trick, the points may be discarded since scoring only counts the challenging team's points), and then leads off the next trick. Only three ranks of cards are worth points: fives are worth five points, and tens and kings are worth ten points.
Any single card or pair of identical (i.e. same suit and rank) cards can lead off a trick.
At the end of the last trick of each round, the points won by the challenging team are summed. If the winner of the last trick is a member of the challenging team, this sum is incremented by double the point value of the eight dead cards that the KotH placed face-down to get the challengers' final score; otherwise, their final score is the total points that the challengers won in the round.
If the challengers' team's final score is less than 80, then the KotH's teammate becomes the KotH of the next round, and if the challengers' final score is also 40 or greater, the defenders each gain one rank. If the challengers' final score is less than 40 but greater than 0, the defenders each gain two ranks. If the challengers' final score is 0, the defenders each gain three ranks.
If the challengers' final score is 80 or greater, then the KotH of the next round is the challenging player closest to the KotH's right. If challengers' final score is also less than 120, no players gain any ranks. If the challengers' final score is at least 120 but less than 160, the challengers gain one rank. If the challengers' final score is at least 160 but less than 200, the challengers gain two ranks. If the challengers' final score is at least 200, the challengers gain three ranks.