People go to Las Vegas and Atlantic City every year believing they can beat the odds and bring home a jackpot. To do this, many come armed with their own personal strategy to topple the casinos. For those without a strategy, the casinos themselves even offer several in their gift stores! A popular gambling game is Black Jack because it is simple to learn, fun to play, and one of the few winnable casino games. Due to its popularity, many different versions of Black Jack have been invented. To improve your chances of making it big, you will need to practice and hone your strategy before trying it in a real casino.
You are to create a program that simulates a person with a personal strategy playing one of the many variations of the game of Black Jack against a dealer (who has a fixed set of rules she must follow). The official rules of Black Jack are available online here. Note, in the basic version of your program, you do not need to implement the rule that allows a player to split her hand when dealt two cards with the same value. On startup, the player should be able to choose which version of Black Jack she wants to play. Thus your program must offer at least the basic rules given above and any two of the many variations given online here.
Your program must also provide at least four different strategies for a player to choose whether she wants to hit or stand given her current hand of cards and the dealer's face up card: the dealer's rules, a random choice, and two others of your own choosing. An in-depth study of one strategy is presented online here.
Finally, your program should keep track of how often the player beats the dealer and report the winning percentage after a certain number of games have been played.
One way to learn how to design your program is to learn more about the domain your program is modeling. The following links may be useful to help you learn more about Black Jack:
It should be as easy as possible to change the following components of your program:
Next in importance to your grade, your project should be thoroughly tested to prove to the course staff that your confidence in it is justified. You should include whatever data files, driver programs, or shell scripts (as well as documentation on how to use them) you have used in your submission. If you do all of the above well, the maximum grade you can receive is an A-.
Finally, the extensions given below are intended to stretch your design further and to differentiate your program from others in order to capture the global "Gambling Simulation" market, you must do at least two such extensions if you want to be considered for a grade in the A range. These extensions must further the good design of your program and not simply be hacks of code added at the last minute. If you do not have time to implement an extension, partial extra credit may be given for excellent justification of how your design either supports adding such a feature already or how it would need to changed sufficiently to support such a feature.
Some suggested extensions follow (listed roughly in order from easiest to hardest):