Różne meteoryty

This commit is contained in:
2024-11-22 09:38:13 +01:00
parent 94a6d081a1
commit 0c4cdf35b1
4 changed files with 14 additions and 12 deletions

View File

@@ -4,15 +4,11 @@
#include <random>
class RandomNumberGenerator {
private:
std::random_device rd;
std::mt19937 gen;
std::uniform_int_distribution<> dis;
public:
RandomNumberGenerator() : gen(rd()), dis(0, 499) {}
int getRandomNumber() {
static int getRandomNumber(int min, int max) {
static std::random_device rd;
static std::mt19937 gen(rd());
static std::uniform_int_distribution<> dis(min, max);
return dis(gen);
}
};