Advertisement
Guest User

Die

a guest
Sep 22nd, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package dicegame;
  7.  
  8. import java.util.Random;
  9.  
  10. /**
  11.  *
  12.  * @author Silas
  13.  */
  14. public class Die {
  15.  
  16.     private int eyes;
  17.     private Random randRoll = new Random();
  18.  
  19.     public void roll() {
  20.         eyes = randRoll.nextInt(6) + 1;
  21.     }
  22.    
  23.     public int getEyes() {
  24.         return eyes;
  25.     }
  26.  
  27.     public Die() {
  28.  
  29.     }
  30.     /*
  31.      private int roll(){
  32.      Random randRoll = new Random();
  33.      return randRoll.nextInt(size)+1;
  34.      }
  35.      */
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement