2026-03-01 12:16:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
class Random
|
|
|
|
|
{
|
|
|
|
|
private:
|
2026-03-02 15:53:32 +07:00
|
|
|
int64_t seed;
|
2026-03-01 12:16:08 +08:00
|
|
|
bool haveNextNextGaussian;
|
|
|
|
|
double nextNextGaussian;
|
|
|
|
|
protected:
|
|
|
|
|
int next(int bits);
|
|
|
|
|
public:
|
|
|
|
|
Random();
|
2026-03-02 15:53:32 +07:00
|
|
|
Random(int64_t seed);
|
|
|
|
|
void setSeed(int64_t s);
|
2026-03-01 12:16:08 +08:00
|
|
|
void nextBytes(byte *bytes, unsigned int count);
|
|
|
|
|
double nextDouble();
|
|
|
|
|
double nextGaussian();
|
|
|
|
|
int nextInt();
|
|
|
|
|
int nextInt(int to);
|
|
|
|
|
float nextFloat();
|
2026-03-02 15:53:32 +07:00
|
|
|
int64_t nextLong();
|
2026-03-01 12:16:08 +08:00
|
|
|
bool nextBoolean();
|
|
|
|
|
};
|