Subsections

Homework #19 (Due: Mon 06 Apr / Wed 15 Apr)

\begin{purpose}
This main purpose of this assignment is to provide practice in s...
...major structures and concepts
that we've learned up to this point.
\end{purpose}

Overview

Write a program that will allow a user to play a dice game against the computer. I'm calling the game ``Drop Dead Remix'' ...it is a variation of a game called ``Drop Dead''.

The rules for the original game are described at http://www.scribd.com/doc/103089/A-to-Z-of-Dice-Gamesas follows:

A good game requiring five dice and a score sheet. Play: Each player in turn rolls the five dice and scores when none of the dice thrown show a 2 or a 5. If a 2 or a 5 are not thrown the player scores the total of the numbers rolled. If a 2 or 5 is thrown they score nothing and put to one side all the dice showing a 2 or 5. These dice are dead and the player continues rolling without them, putting to one side any dice showing a 2 or a 5 and scoring when neither are thrown, until all the dice are eliminated. Once the final die has turned up as a 2 or 5 the player is said to have dropped dead and it is the next player's turn. A running tally of a player's score is kept and the player with the highest score after every player has had a turn wins the game

Drop Dead Remix follows the same rules as Drop Dead except for these additional guidelines:

  1. After each role the player is given an option to end their turn early. Their final turn score is multiplied by the number of live dice remaining. Thus if a person plays until all dice are dead then their turn score will be multiplied by 0 resulting in a score of 0.
  2. Game continues until one or more players reach 200 points. If multiple players reach 200 points in a single round then the player with the highest score wins.

After a game is complete, your program will name the winner (or declare a tie if appropriate) and then allow the user to indicate whether or not they want to play another game.

Design (Due: Mon 06 Apr)

This program would be difficult to write if you were required to do so without using methods. The first challenge, then, is to decide how to split the assignment into parts. I recommend the following steps:

At the end of this process you should have identified four or five individual methods and you should have fairly detailed steps for what each method will have to accomplish.

Coding (Due: Wed 15 Apr)

With your design (algorithm) in hand, you are ready to begin writing the program. Start by selecting one of the ``bottom-most'' methods (i.e., one that doesn't call any other methods) and implementing it. Test it thoroughly before you move on to other methods. Continue implementing methods one-by-one from the bottom-up until you are finished! This game requires the use of 5 dice, so I recommend storing the dice as an array. I have provided a method that will display dice values in an array using ASCII art. The method is available at http://josephus.hsutx.edu/classes/p1/source/DropDeadStarter.java.

Grading Criteria

When turning in your program, you should bring a printout of your source code to class. In addition you should email a copy of your source code to the homework account: cscihomework@hsutx.edu.

The design portion of the assignment is has 15 possible points and will be graded according to the level of detail provided and whether or not the design is correct (in terms of producing the desired outcome).

The coding portion of this assignment will be graded according to the following criteria:

Correctness/Completeness 20 pts
Documentation 4 pts
Design/Structure 6 pts
Total 30 pts

tsergeant@hsutx.edu

Quick Links