CPSC 120 Assignment #4 - Part II
Enhanced Blackjack

Corrected Part I and Part II Due Friday December 5, 2008 by 4 p.m.

In this part of the assignment you will add two capabilities to your Blackjack classes. One is to include the "Five card charlie" (also called the "Five card trick") rule that a player wins automatically if he/she has 5 cards with a point count of 21 or less. The other capability is for the player to be a computer. You will also write a client program that plays the game multiple times with the computer versus the dealer and counts the times the computer wins, the dealer wins, and the two tied. You will run your program many times to see if you can find a computer strategy that is better than the dealer strategy.

The computer as a player:

There would be several different ways you could add capabilities to your Player class for the player to be a computer but we will have the computer use a variation on the dealer's rules. (NOTE: You must implement this type of computer player. If you wish you can add another player type to the Player class where the computer is a player with rules you make up.) Recall that the dealer always hits on counts of 16 or less and always sticks on counts of 17 or more. The computer will choose to sometimes hit and sometimes stick for certain point counts (the choice will be based on randomness). For example, the computer may hit 100% of the time on a count of 12, 90% of the time on a count of 13, 80% of the time on a count of 14, 70% of the time on a count of 15, 60% of the time on a count of 16, and 50% of the time on a count of 17. The computer would always hit for 11 or less and always stick for 18 or more. Use the following algorithm for determining the computer's strategy:

Working Strategy and Requirements

Grading As usual, your program will be graded both on style and correctness. You will receive a grade on your corrected part I (based on 100 points) and a separate grade on part II (it will be based on 50 points). For this part you need to use your program to find the best strategy. The document that shows your results from running the program and gives your conclusion about the best strategy will be 30% of the part II grade.

Academic Integrity Reminder!!! Programming assignments are to be your own work. You may get help on the specifics of the assignment from no one except the instructor. You may not show your program to anyone or look at anyone else's program or share ideas with anyone about how to write the program.

Hand IN: A printed copy of your program files. and your original part I hard copies that have been marked by me. Also turn in a paper with the results of your runs and your conclusions for part II. Tar all of the assignment files (both parts of the assignment - everything should be in an assign4 directory) and email the .tgz file to your instructor with a subject of cpsc120 assn4 part II.

Disclaimer

The comments written on your original Blackjack program are there to help you find and correct errors. However, there may be additional errors that are not pointed out in the comments. It is your responsibility to thoroughly test your programs and correct all errors.