-
-
Notifications
You must be signed in to change notification settings - Fork 5
Random Number API
Nenkai edited this page Jul 13, 2024
·
3 revisions
// Getting a number from a range
var value = pdistd::MRandom::GetValue(0, 10);
// Getting a float from a range
var float_value = pdistd::MRandom::GetValue(0.0, 10.0);
var rand = main::pdistd::MRandom();
rand.mt_seed = 42;
// You could also set it from the time (good practice)
rand.mt_seed = main::pdistd::GetSystemTimeMicroSecond();
var seeded_value = rand.getMTInt();
var value_from_range = rand.getMTInt(0, 10);
var float_value = rand.getMTFloat(0.0, 10.0);