DiceRNG

Creates an object that acts as a cubical 6-sided die. The die can be rolled by either calling the public roll function or the overloaded parentheses. If a number is supplied it will roll the die that many times and return the results as a vector of integers

References

*https://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution
*https://www.cplusplus.com/reference/vector/vector/reserve/

Art by valkyrie

+https://www.asciiart.eu/miscellaneous/dice

Author

Jeffrey S. Rankin
http://jsrankin.com
[email protected]

int main()
{
    DiceRNG d;

    std::cout << "One roll:\t" << d() << std::endl;
    std::cout << "One roll:\t" << d.roll() << std::endl;
    
    return 0;
}

GitHub

View Github