/**
 * Simulates a Die object.
 *
 * @author Chris Mayfield
 * @version 11/14/2016
 */
public class Die {
    private int face;

    /**
     * Constructs a new die with a random face value.
     */
    public Die() {
        roll();
    }

    /**
     * Simulates the roll of the die.
     *
     * @return new face value of the die
     */
    public int roll() {
        face = (int) (Math.random() * 6) + 1;
        return face;
    }

    /**
     * Gets the current face value of the die.
     *
     * @return current face value of the die
     */
    public int getFace() {
        return face;
    }

    public static void main(String[] args) {
        //1 Declare the array of objects 
        Die[] yahtzee;
        System.out.println("1--------");
        //System.out.println(yahtzee);
        //2 Instntiate the array of objects
        yahtzee = new Die[5];
        System.out.println(yahtzee);
        System.out.println("2--------");
        System.out.println(yahtzee[0]);
        //3 Instantiate each object.
        System.out.println("3--------");
        for (int i = 0; i < 5; i++) {
            yahtzee[i] = new Die();
            System.out.println("Dice #: " + yahtzee[i].getFace());
        }
        
        
    }

}
