Guest User

Untitled

a guest
Sep 25th, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. // don't forget comments here..
  2. public class PigDice {
  3.  
  4.     public static void main(String[] args) {
  5.  
  6.         // create a Random number object
  7.  
  8.         // create a integer variable called totalScore
  9.  
  10.         // create six integer variables for each dice
  11.  
  12.         // print out a welcome message
  13.  
  14.         // generate the random number between for 1 and 6 for each die
  15.  
  16.         // check if any of the dice are 1
  17.         if (die == 1 || die2 == 1 || die3 == 1 || die4 == 1 || die5 == 1
  18.                 || die6 == 1) {
  19.             // print out a message that they recieved no score
  20.  
  21.         } else {
  22.             // add all the dice up and add it to the totalScore
  23.  
  24.             // print out the individual values from the dice
  25.            
  26.             // print out a total score
  27.  
  28.             // check to see if they have won the game
  29.             if (totalScore > 20) {
  30.                 // print out a message that indicates that they have won
  31.  
  32.             }
  33.         }
  34.  
  35.     }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment