CSC 101 Programming Assignment 6
A Card Game Program
This assignment continues the work of programming assignment 5. Here you will finish the design and implementation of a program to play the card game you chose in assignment 5.
The program begins by offering to display game instructions to the user. If the user chooses to view instructions, they are displayed on the terminal in successive "pages" of 20 lines each. The user can go to the next page of instructions, go to a previous page, or quit the instructions.
Once the instructions are completed, game play begins. At this point, the user's hand is displayed on the terminal and the user is prompted to enter a game-playing command. The specific playing commands depend on the game the program is playing.
In addition to game-specific commands, the following general commands must be available to the user:
The details of user interface design are up to you. To give you a rough idea
of how game play would look, here is a very generic game play session. Output
form the program is shown in normal typewriter font. Input from the
user is show in bold typewriter font
-- Welcome to <your card game name goes here> --
Command Meaning
===========================================
h hit me with another card
p pick a card from the top of the deck
d C discard card C from my hand
s show dealer's hand
i display full instructions
? display short help
q quit the game
Enter a command: h
Your hand contains: AC AD AH AS KC
The dealer takes a hit.
Enter a command: d AH
Your hand contains: AC AD AS KC
The dealer discards 2C
Enter a command:
...
Congratulations, you win!
Here are some noteworthy features of this generic example:
Depending on the game, there are some potential convenience issues that the program should address. These include:
As always, most of the implementation details are up to you. Here are the specific design and implementation requirements you must meet:
Note carefully the requirement for at least four testing functions. This means that you must choose at least four program processing functions for which you write a separate testing function. These four functions must be other than the four functions you wrote for programming assignment 5.
If you want, you can organize your program using multiple .h files, but this is not required. You can name your files "program6..., or a more mnemonic name, like the name of the card game.
The assignment is due no later than 9PM Wednesday, June 9. Note that this is the middle day of finals week. Turn in the program files electronically. Turn in the design diagram on paper to the CSC department office drop box.
The name of the assignment for electronic turnin is program6. Since your program consists of multiple files, use the turnin program to submit each of them.