Zig NEWS

Discussion on: How to use the random number generator in Zig

Collapse
 
pyrolistical profile image
Pyrolistical

I keep forgetting if I should be holding on to a std.rand.DefaultPrng or std.rand.Random.

The correct answer is to never hold on to std.rand.Random. Always access it via .random() or else the internal seed won't be incremented and you will always get the same (ie. non-random) values