public class Dice
extends java.lang.Object
Have a look through the file to see how a simple object class is constructed. The dice class has a random number generator and an int number of sides. We can roll the die to get a random value in the game.
Constructor | Description |
---|---|
Dice(int sides) |
Create a new dice with a given number of sides.
|
Modifier and Type | Method | Description |
---|---|---|
int |
roll() |
Rolls our simulated dice.
|