/** Die: simulate rolling a die

 * This is the Die code, to simulate rolling a die, that we wrote in
 * class on Jan 24. We know that it compiles, but haven't tried
 * running it yet. It has no comments yet, except for this block that
 * I'm writing on top. 
 *
 * <p> We wrote it in several steps, starting at the whiteboard - not
 * starting with typing code! First, we talked about the functionality
 * that we wanted to support, then turned that into a UML diagram. 
 * Finally, we typed in some code to implement that diagram.
 */ 

import java.util.Random;

public class Die
{

    private int sides;

    public Die() 
    {

    }

    public void setSides(int numSides)
    {
	sides = numSides;
    }

    public int roll()
    {
	Random gen = new Random();
	return gen.nextInt(sides) +1; // number from 1 - numsides
    }
}

