Gambling Fools


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. 

Specifications

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. 

Design Goals

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:

Extra Credit

There are many extensions to the basic specifications possible; some are listed below (note, you can certainly add more strategies, but that will not be worth as much extra credit as something that stretches your design in a new direction). From the stand point of your grade, the most important thing is that your program is designed well (i.e., that it is possible to add new kinds of strategies and new kinds of rules simply by creating a new subclass and adding O(1) line to your existing code to include the new class). The requirements above are intended to help you to realize such a design. 

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):

Deliverables

  1. Monday, September  8.
    1. Create a web page with your team name, an estimate of how long you expect it to take your team to complete this project, a description of the classes you envision as part of implementing this project, and a list of issues that arise as you try to pin down the requirements, e.g., vague, ambiguous, conflicting requirements. We will check this page frequently to check on your progress, so you will need to update this web site as you develop your project.
  2. Friday, September 12. As a minimum, your program should be able to
    1. simulate a player with a random strategy playing the basic game of Black Jack any number of times
    Your web site should include a user manual and a programmer manual that correctly describes the current implementation.
  3. Monday, September  15.
    1. Your preliminary final version of program is due that implements all of the major features reasonably well.
    Your web site should include a user manual and a programmer manual that correctly describes the current implementation.