So computer programmers like to give other new computer programmers tests to see how good they are. The make them make computer games. Simple computer games are good, but the more complex the better. Poker for instance is really tough to program well. Crazy Eights or Go Fish, is easy. Solitaire pretty simple, because it is just patterns. Hearts though, is middle of the road in complexity.
Hear are the rules. Deal out to four players all the cards in the deck, no jokers please. The player with the two of clubs leads with that card. the leading character can lead with what ever card he wishes as long as it is not a heart until another player has played a heart, or the lead has no other cards to play. When the lead plays a card of one suit, all the other players must play another of that suit, unless they have no cards of that suit, then they may play another suit. The player that has played the highest value of the lead's suit, (aces high, twos low) becomes the new lead and can play any card that they want next. When all the cards have been played the players count the number of hearts in their cards they have won and this counts as the score. Lowest score is the winner. Or the first player over 100 points loses and the lowest score has one.
That is the basics, but there is more. Each heart is worth one heart, but the Queen of Spades is worth more, often 13 points. When the hand is first dealt each player selects the three cards that he feels hurt him the most and removes them from his had and passes them to another player. The first match they are passed to the right, the second to the left, the next to the person across from you and lastly you keep what was dealt to you. There is one more very important rule, if one player amasses all the points a hand can give him, his score is counted as zero and all the other players get a maximum score instead. There are variations to the rules all over the place. My family plays with the ten of heart worth ten points instead of one and we have a three man alternate game each player gets 17 cards and the last card goes to the winner of the first round, which means if you are going for all the cards you need to get the first one too, just incase it has a heart in it.
Programming this game is difficult but not as hard as poker. Typically the extra players are programmed to get the lowest scoring hands and to avoid the wild cards like the Queen of Spades, but the really best programmers put strategies to try to get all the cards. I have one game that I do poorly in but I have another that I am winning most of the time, I am winning about ninety percent of the time. In that game, the computer usually discards three high value cards in one suit, while I discard my low value cards, this has let me get all the points about twice per game. If the game learned from my style I would be screwed. The harder game discards seemingly at random and is more like playing against a person.
No comments:
Post a Comment