You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does your function guarantee uniform distribution? If not, we should stick to Math.random.
To introduce nondeterminism, we can discard k results from PRNG, where k depends on system time.
Does your function guarantee uniform distribution? If not, we should stick to Math.random.
To introduce nondeterminism, we can discard k results from PRNG, where k depends on system time.
tbh,i get those functions from others, if u doubt the uniform distribution of function,u can go there https://www.zhihu.com/question/22818104 hope it can solve your questions
由于您代码中的随机数生成是固定的,导致每次第一次出现的cxk图片都是固定的,非常影响观感,建议修改
随机数生成代码如下
`function rnd( seed ){
seed = ( seed * 9301 + 49297 ) % 233280; //为何使用这三个数?
return seed / ( 233280.0 );
};
function rand(number){
today = new Date();
seed = today.getTime();
return Math.ceil( rnd( seed ) * number );
};
myNum=(rand(5));`
The text was updated successfully, but these errors were encountered: