diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-29 21:30:38 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-29 21:30:38 +0100 |
commit | a04cb74fee079e3ee43ae5fae32fc2674409822c (patch) | |
tree | 403e681a768ee68b54569e93d98e741878cd7975 /backend/RNG.h | |
parent | 9283e1eb66d6ff96b02f317e28cb6ff060953cdf (diff) |
implement movement
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; +}; + |