Confusion about `Random`

jwatson-CO-edu real.name at colorado.edu
Thu Dec 22 20:17:56 UTC 2022


On Thursday, 22 December 2022 at 17:33:48 UTC, Paul Backus wrote:
> So, as far as I can tell, there is nothing wrong with your 
> code, and the random number generator is working as intended.
>
> Most likely you have made a mistake somewhere in the part of 
> the code that you did not post, and that mistake is what's 
> causing the lack of randomness you observed in the output.

Right, the entire project is about 2k lines, so I didn't post it.
I've isolated the problem to instances when my program is 
interpreting a loop.
Somehow the loop context must be storing an old seed for `rnd`?
I'm still searching for the issue and I have not been able to 
replicate it in smaller example.




More information about the Digitalmars-d-learn mailing list