#ifndef GETRANDOM_H #define GETRANDOM_H #include using std::random_device; using std::mt19937; using std::uniform_int_distribution; inline int GetRandom(const int upperbound, const int lowerbound) { random_device rd; // a seed source for the random number engine mt19937 gen(rd()); // mersenne_twister_engine seeded with rd() uniform_int_distribution<> distrib(lowerbound, upperbound); return distrib(gen); } #endif