Skip to main content Link Search Menu Expand Document (external link)

Chapter 2: Dice Notation

In this part of the project you will implement a DiceGroup class that allows you to specify groups of like-sided dice to be rolled together. For example, in Dungeon and Dragons, a character’s ability scores are generated using 3 six-sided dice (3d6).

Additionally, in Part 2 you will create a Dice Roller Scene that will allow the user to specify a DiceGroup using Dice Notation and roll it. For example, in the project below, you can enter 3d6 and roll the dice to see the possible outcomes. You could also enter 20d100! Give it a try!

2.1: Dice Group

In this chapter, you will write a DiceGroup class which represents a group of like sided dice that can be rolled together.

2.2: Dice Group Roller

In this chapter, you will use everything you’ve learned thus far (and more) to implement a Dice Group Roller that allows the user to specify a DiceGroup and roll it.


Join the Discussion

If you're stuck, have questions, or want to provide feedback, you can do so below. However, I ask that you please refrain from posting complete solutions to any of the challenges.

Before commenting, you will need to authorize giscus. Alternatively, you can add a comment directly on the GitHub Discussion Board.


Table of contents