Brief Program Description: Chuck-A-Luck

Chuck-A-Luck is a simple gambling game that is played using three dice. In general, before the dice are rolled a player can place one or more bets on the outcome of the roll. The dice are then rolled and the bets are processed.

For this exam, you will write a program using Java components in the MVC design pattern, HTML, CSS and Java classes that will allow a user to play a single player version of the game ChuckALuck.

Chuck-A-Luck Resources:

You can read about the game of Chuck-A-Luck at the following Web sites. You can visit other sites if you wish. Keep in mind that these are for general background, your solution should follow the MIST7570 Chuck-A-Luck variation described below. Remember, you are not likely to be able to write a program for a problem if you don't fully understand the problem before you program it.

  • Wikipedia: https://en.wikipedia.org/wiki/Chuck-a-luck
  • Wizard of Odds: https://wizardofodds.com/games/chuck-a-luck/

MIST7570 Chuck-A-Luck Variation:

Use the following game rules for our Chuck-A-Luck variation. These variations from the usual rules are provided to reduce the scope of the program and make it a little easier for you to develop the game using the components you currently know how to use and to complete during the time allowed.

  • Rolling Dice: The roll of three dice should be randomly generated in your program for each roll after the bets has been placed. The three dice must be displayed as images on the page showing the roll results.
  • Bets: Your program should allow the player to place the following bets with the following payouts (based on those listed on the Wikipedia ChuckALuck page)
  • Roll Results: After each roll, messages that detail the outcome of each bet placed and the amount won or loss should be displayed.
  • Updating Purse: The purse is the amount of money that the player holds at any time. You can choose how much the player starts with - for example, a player may start with a purse of $1,000. After each roll, the purse is updated based on the wins/losses of that roll and the current purse is displayed. A message based on the final value of the purse should be displayed in the final results about whether a player has won or lost.
  • Quitting the game: The game is over and the results page is displayed for two possible cases:
    • The player decides that they have had enough and clicks the quit button. Overall results are tallied and displayed on the results view.
    • The player's current bank is at or below zero. In this case, the only button displayed is the quit button and the player is not allowed a new roll. Overall results are tallied and displayed on the final results view.

General Program Requirements:

For your program, you must create an Eclipse project that contains Java classes, tsp pages or servlets combined in the MVC design pattern for each use case, CSS file(s), HTML, and images.

MVC: You must implement the controller/view using the MVC design pattern. You will need at least one set of MVC components for each of the different use cases (except for the index.jsp that provides the opening splash page).

Java Classes: Your solution should include two Java class that are used by your Controller/View components. One Java class (Die) has been provided along with these instructions. You may import this into your project and use it as is, or you may alter the Die Class if you want, or you may write your own from scratch. Your solution should include a second Java class with methods that help you run the game.

CSS file: Your solution should include CSS to style the pages. Your design can be similar to that shown in my figures but you should put your own design twists on the views. You should include enough here to demonstrate that you can use CSS for:

  • linking to the same CSS file from all view pages
  • centering the content in the page
  • use playing card images to display the drawn cards. (the tags of course will be html based but you should CSS to position them)
  • set background colors
  • style the fonts on the page
  • at least three other style items of your choice
  • It's okay to include a minimal set of CSS within the view pages if warranted, but keep most style commands in the external CSS file.

Dice images: A set of dice images are provided along with these instructions. Feel free to use these as part of our program. Remember that they need to be imported into the appropriate location of your Eclipse project in order to work with your program.

Example Chuck-A-Luck Views:

Note: This section will best be understood after you have researched the game of Chuck-A-Luck and thoroughly read the instructions above. It is provided as an example. Your solution should have the main elements shown here, but you may have a different look and feel (style - CSS). In fact, you should use your own design.

Opening page (view 1):

Figure 1 provides a view of the opening screen. Note, that you are not required to copy the style from these examples.

Figure 1 - Opening page (view 1) see image.

Bet page (view 2):

In Figure 2, the player has clicked Play from the opening screen to start the game or has continued play after previous rounds. This page presents the betting options. The user can: select bet types, add any additional information needed (like die selection for the Single bet), and enter bet amounts for each type selected.

Figure 2 - Deal page (view 2) see image.

Roll page (view 3):

In Figure 3 we see the results of a single roll of the dice. Several messages are provided about the outcome of each bet. Note that for this example, only three bet types were selected so there are correspondingly three outcome messages. The number of messages should vary with the number of bet types shown (could be any number of messages from 1 to 5). You should also indicate: the overall winnings/losses for the roll; the updated purse, and the number of rolls played this session.

Figure 3 - Reveal page with a bet results (view 3) see image.

Final Results page (view 4):

In Figures 4, we see an example of the final results page. Appropriate messages about the results and the final status of the player's purse are displayed. The player can choose to play again.

Figure 4 - Final Results (view 4) see image.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.