Skip to content

bradJM/dice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Dice Roller Class

  • Ross Smith 2018
  • Open source under the MIT License

The Dice class is a random number distribution that emulates rolling multiple dice of different kinds, and applying some limited arithmetic to the results. A set of dice can be specified either by building it up from instances of the Dice class, or by parsing a string in a conventional format.

Examples:

// These both produce the same distribution
auto dice1 = Dice(2, 10) * 5 + Dice(3, 6) + 10;
auto dice2 = Dice("2d10x5 + 3d6 + 10");

Also included is a basic rational number class, to allow dice rolls to yield fractional results without truncation.

Documentation

About

C++ dice roller class

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published