A Die for my Project
Note from previous code
[[falltrhoug]];
makes it so the compiler doesn't complain about missing breaks in case/switch statements.
rand()
Reference
produces an integer between 0 and RAND_MAX
usually used with % operator
or % + 1 in some cases.
srand
Seeds the random number generator.
takes an unsigned int as a parameter.
Only call this one time per program.
Don't call, or call with a constant when debugging.
Don't use this is serious simulations.
Nomral usage
srand(static_cast<unsigned int>(time(nullptr)));
I have the following
The definition of the numeration type
The definition of FIRST_RESULT
The definition of RESULT_RANGE
Function to
Convert a string to a ResultT
Convert a ResultT to a string
A roll Die function.
A call to srand (but only one).
See
dieFinal.cpp