The following text was written to the standard output stream when the Die program was executed from Netbeans.
/*
* Model a die in terms of two properties
* - order, the number of faces
* - top, the values of the top face
*/
package chance;
/**
*
* @author dmaslows
*/
public class Die {
public static void roll(int i) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
private int order;
public int top;
public Die() {
order = 6;
top = (int) ((Math.random() *6)+1);
}
public Die(int nrOfSides) {
order = nrOfSides;
top = (int) ((Math.random()*nrOfSides)+1);
}
public int top() {
return top;
}
public void roll() {
top = (int) ((Math.random() * order)+1);
}
}