mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 01:59:19 +02:00
Replace fancy Random function with std::uniform_real_distribution
This commit is contained in:
@@ -96,8 +96,8 @@ bool ClearFlag(int &Flag, int const Value)
|
|||||||
|
|
||||||
double Random(double a, double b)
|
double Random(double a, double b)
|
||||||
{
|
{
|
||||||
uint32_t val = Global.random_engine();
|
std::uniform_real_distribution<double> dist(a, b);
|
||||||
return interpolate(a, b, (double)val / Global.random_engine.max());
|
return dist(Global.random_engine);
|
||||||
}
|
}
|
||||||
|
|
||||||
int RandomInt(int min, int max)
|
int RandomInt(int min, int max)
|
||||||
|
|||||||
Reference in New Issue
Block a user