diff options
Diffstat (limited to 'backend/RNG.h')
-rw-r--r-- | backend/RNG.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/backend/RNG.h b/backend/RNG.h new file mode 100644 index 0000000..ded337c --- /dev/null +++ b/backend/RNG.h @@ -0,0 +1,23 @@ +#pragma once + +#include <random> + +class RNG { +public: + static RNG & get(); + +public: + int rand_int(const int upper); + int rand_int(const int lower, const int upper); + double rand_double(); + double rand_double(const double lower, const double upper); + bool rand_bool(); + +private: + RNG(); + +private: + std::random_device dev; + std::mt19937 rng; +}; + |