CS361
Project 8
Adding another solitaire game
due: Friday, May 2, before I leave for the day
Assignment
Add another new feature to your program: a new Poker solitaire game.
Details
-
Add a new "Poker" menu item to the "Game" menu that, when chosen, brings up a (incredibly simple and stupid) Poker solitaire game:
- The computer and user are each dealt five random cards. The computer cannot change its cards but the user can click on up to two of her cards. When a card is clicked, it is replaced with another random card from the deck.
- After the user has replaced up to two cards, the "Find winner" button can be clicked and a dialog will appear announcing the winner.
- To determine the winner, follow the standard poker 5-card rules, in which hands have the following ranking (best to worst):
- royal flush
- straight flush
- four of a kind
- full house
- flush
- straight
- three of a kind
- two pair
- one pair
- high card
- If the computer's hand and the user's hand both have the same ranking from these 10 rankings, you can treat it as a tie.
- All the menu items must work correctly for this game, except the "Shuffle" menu item.
Extra Credit
- For a few points extra credit, calculate the winning hand more precisely. For example, if the computer has four kings and a deuce and the user has four nines and a queen, then it really isn't a tie. Instead, the computer wins since the rank of the four kings is higher than the rank of the four nines. Follow the rules found at: http://www.pagat.com/vying/pokerrank.html
- You can also make up your own enhancement. If it is well done, I will give you extra credit points for it. You might want to clear it with me first.
What to hand in
Hand in a hard copy
of all the source code files you created or modified and also zip up all source
code files and send the zip file to me
as an email attachment. See the course
web page on handing in assignments for further details. Also, I want you to hand back in the hard copy of Project 7 that has my red marks on it.
For
fun: An Ambiguous Recommendation
"I would urge you to waste no time in making Ben an offer of employment."