-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
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
random is broken #371
Comments
Hi @clankill3r Thanks for the bug report. Are you referring to the v2 version or are you using v1? Lines 689 to 709 in cb1e7c6
For comparison here is the code from p5js https://github.com/processing/p5.js/blob/c3f4121619174db5eaaf09b8ca51c93d530caa27/src/math/random.js#L86-L149 Can you provide the code you used to create these values? Or even better write a failing test based on the v2 branch? |
Ok, I did some tests. As soon as you use a randomSeed it breaks. #includepath "~/Documents/;%USERPROFILE%Documents";
#include "basiljs/bundle2/basil.js";
function draw() {
clear(page());
randomSeed(43535);
txt = "";
for (var i = 0; i < 25; i++) {
txt += random(4, 8) + "\n";
}
textSize(100);
text(txt, 50, 50, 4096, 4096);
} |
Thank you @clankill3r We will have a look ASAP. |
Heyhey - just ran into this with a student = |
The values produced by random are like 1000 times lower then they should be.
For example, this are the numbers between 4 and 8:
The text was updated successfully, but these errors were encountered: