Dice Games

Dice games are similar to card games, but the values of the dice are simpler.  Dice have number values between 1 and 6.  Some games, like craps, involves adding the total of 2 dice.  Other games, like Yatzee (Kniffel) involve matching pairs of equal dice.

Here is a very simple prototype with only 2 dice.  In this program, the [Roll] button rolls both dice.  Clicking on either of the pictures rolls just that one die.  Get a copy of the program and the pictures here:   GUIdice2.zip

img1.gif

 
Here are a few specific problems to solve:
  1. Add one more die, so there are 3 dice total.  The checkDice method should
    show the total for all 3 dice.
     
  2. Change checkDice so that it looks for, and announces, any of the following:
    (a) three 6's
    (b) three of a kind (any number)
    (c) any pair (any 2 of the 3 dice)
    (d) make sure that if all three dice match, the method does NOT say "pair".
    (e) if all 3 numbers are different, it says "bust"
     
  3. Make a game with the following rules:
    - There are 3 dice.
    - At the beginning, all 3 dice are rolled.
    - The user may then click 3 times on a single die.  This could be the same die over and over,
       or once on each of the dice, or twice on one and once on another.
    - The player is not required to click 3 times.  They may stop whenever they like.
        Then they click the [checkDice] button, and score according to the following rules:
       --  Add up the three dice.
       --  If all 3 dice are equal, then multiply the total by 3.
       --  If there is a pair (and not 3 of a kind), multiply the total by 2.
     
  4. Make your game keep a GRAND TOTAL and allow the player to play 10 times.
    Each time the user clicks [checkDice], the total gets added to the GRAND TOTAL.
     
  5. Expand your game to 5 dice, and give bonuses for any of the following.  
    Then the player can click 5 times (each time on any die).
    Give points as follows:
    -  no pairs = total of 5 dice
    -  pair = double the total
    -  2 pairs = 4 times the total
    -  3 of a kind = 6 times the total
    -  3 of a kind and a pair (full house) = 8 times the total
    -  straight (1-2-3-4-5 or 2-3-4-5-6) = 10 times the total
    -  4 of a kind = 15 times the total
    -  5 of a kind = 20 times the total

    The program should still allow the player to play 10 times and keep a GRAND TOTAL.