# Die Throwing
Create a Die
class for a 6
sided die. Implement a roll()
method that returns a random number between 1
and 6
.
Create a small demo app that demonstrates the usage of the class Die
. Roll the die a couple of times using a for
construct.
Now refactor the Die
class so the 6
limit is not a magic number anymore. Make sure it can be passed via the Die
constructor of the class. This way you should be able to create a 6-sided die or a 20-sided die.