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
Hi,
In random_gen functions, e and ud are static. Because they are static, they will be initialized only once. This means their range and seed cannot be changed after the first call to random_gen. For example: random_gen(0, 1, 9); random_gen(3, 0, 100);
The second call to random_gen returns a random unsigned from [1, 9] and the seed that e uses is 0.
This is my proposed solution for 17.30 (the same can be applied to 17.29):
Hi,
In
random_gen
functions,e
andud
arestatic
. Because they arestatic
, they will be initialized only once. This means their range and seed cannot be changed after the first call torandom_gen
. For example:random_gen(0, 1, 9);
random_gen(3, 0, 100);
The second call to
random_gen
returns a randomunsigned
from [1, 9] and the seed thate
uses is 0.This is my proposed solution for 17.30 (the same can be applied to 17.29):
Thanks
The text was updated successfully, but these errors were encountered: