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 an array 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. An excellent program will also store any help text in an external file and will read in and display it when rules are asked for.

An excellent program will 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.




©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License