We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please, before submitting a new issue verify and check:
Multiple calls to GetRandomValue without a call to InitWindow() first will always yield the min value. For example:
GetRandomValue(10, 100); GetRandomValue(10, 100); GetRandomValue(10, 100); GetRandomValue(10, 100);
will always yield 10.
Expected behaviour even without setting the seed would yield a number other than 10.
Windows 11
#include "raylib.h" #include "raymath.h" int main() { /* const int screenWidth = 800; const int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib [core] - GetRandomValue bug"); */ int rand = 0; for (int i = 0; i < 10; i++) { rand = GetRandomValue(10, 100); printf("Rand %d\n", rand); } }
The text was updated successfully, but these errors were encountered:
Set default init values for random #3954
f100755
@ChinaBackGo Fixed!
Sorry, something went wrong.
No branches or pull requests
Please, before submitting a new issue verify and check:
Issue description
Multiple calls to GetRandomValue without a call to InitWindow() first will always yield the min value. For example:
GetRandomValue(10, 100);
GetRandomValue(10, 100);
GetRandomValue(10, 100);
GetRandomValue(10, 100);
will always yield 10.
Expected behaviour even without setting the seed would yield a number other than 10.
Environment
Windows 11
Issue Screenshot
Code Example
The text was updated successfully, but these errors were encountered: