April 2015
Beginner
320 pages
7h 43m
English
In this chapter, you’ll build on the code written in the previous chapter to let you roll a die of any number of sides. Sometimes you want a random number that doesn’t fit in the range 1 to 6. Ideally, you’d like your virtual dice module to return a random number for any range you give it. You’re going to take your six-sided die from the previous chapter and enhance it so it can change shape to any number of sides like the multisided die used in some tabletop and role-playing games (see FIGURE 7.1).

FIGURE 7.1 Multisided dice
If you wanted to expand on what you’ve already done to support dice of ...
Read now
Unlock full access