import java.util.*;

public class Dice {

    private Random random;
    private int    value;

    public Dice( Random random ) {
	this.random = random;
	roll();
    } // end of Dice() constructor

    public Dice( Dice dice ) {
	random = dice.random;
	value = dice.getValue();
    } // end of Dice() constructor

    public void copy( Dice dice ) {
	random = dice.random;
	value = dice.getValue();
    } // end of copy() method

    public void roll() {
	//	value = Math.abs( random.nextInt() % 6 ) + 1;
	value = Math.abs( random.nextInt() % 100 );
    } // end of roll() method

    public int getValue() {
	return( value );
    } // end of getValue() method

    public String toString() {
	return( String.valueOf( value ));
	// same as: return value+"";
    } // end of toSring() method
    
} // end of Dice class
