Initial Commit
This commit is contained in:
commit
6088fc29ed
978 changed files with 353647 additions and 0 deletions
20
include/Helpers/Random.hpp
Normal file
20
include/Helpers/Random.hpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
#include <random>
|
||||
|
||||
class Random {
|
||||
public:
|
||||
static Random& get();
|
||||
Random();
|
||||
template <typename T> T int_range(T start, T end) {
|
||||
std::uniform_int_distribution<T> distribute(start, end);
|
||||
return distribute(randGen);
|
||||
}
|
||||
template <typename T> T real_range(T start, T end) {
|
||||
std::uniform_real_distribution<T> distribute(start, end);
|
||||
return distribute(randGen);
|
||||
}
|
||||
std::string alphanumeric_str(size_t len);
|
||||
std::mt19937_64 randGen;
|
||||
private:
|
||||
static Random global;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue