| Constructor and Description |
|---|
SimpleDice(int sides)
Creates a new dice with the given number of sides.
|
| Modifier and Type | Method and Description |
|---|---|
int |
roll()
Rolls this dice and return the value.
|
int |
sides()
Returns how much sides this dice has.
|
public SimpleDice(int sides)
Only dices with 4, 6, 8, 10, 12 or 20 sides can be created.
sides - the number of the sidesIllegalArgumentException - in case of a unexpected number of sidespublic int sides()
Dicepublic int roll()
Dice
The value will always be in the interval [1, Dice.sides()].
Copyright © 2017. All rights reserved.