Project: Hearts¶
Write a program to play the card game “Hearts”. It is not necessary to print graphical-looking cards on the screen. The game should support four (human) players and scoring. It must never deal the same card twice.
Your program should actually “shuffle” cards in a list before each deal.
You can find some rules for Hearts online.
This assignment is hard, so it is not expected that many of you will actually finish a program that can play a complete card game. Nevertheless, if you’re interested in some “extras” to add:
An excellent program will:
store scores of players and teams in an external file, and read it in again at startup.
will also store any help text in an external file
will read in and display the help text when rules are asked for.
allow for either human or computer players at any position. That is, anywhere from no humans to four humans should be supported. Computer opponents need not be particulary bright, but they should make only legal plays.
Some students express an interest in other card games. Spades is fine, though a little harder than Hearts. Blackjack is not allowed because it’s too easy, and solitaire and poker are not allowed because they’re too hard. For other card games ask me, but if I don’t know how to play it, I probably won’t approve it. Sorry, those are the breaks.
Here are some rules for spades if anyone is interested.
©2021 Daniel Gallo
This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Adapted for Python from Graham Mitchell’s Programming By Doing