Confusion about `Random`

jwatson-CO-edu real.name at colorado.edu
Sat Dec 24 16:16:17 UTC 2022


On Friday, 23 December 2022 at 17:53:24 UTC, H. S. Teoh wrote:
> You probably should give DustMite a shot; from the snippets 
> you've posted so far we haven't found any clues of what might 
> have gone wrong. To narrow down the issue we really need to 
> start from the original code and reduce it to a minimal case.
>
> 	https://github.com/CyberShadow/DustMite
>
>
> T

No need, I have ample logging already written into the program.

False alarm everyone, there was a logical error in my code. And 
not only this, but the error appeared in **none** of the code I 
posted, sorry! I was working from a wrong assumption.

I counted calls to my `rand01` function and realized that the 
number of calls was equal to the number of times `rand` appeared 
in the file being interpreted, rather than the number of times it 
should have been evaluated.  Then it became clear that the parser 
was replacing calls to `rand` with a number, which was displayed 
repeatedly when a loop was evaluated.  I removed `rand` from the 
dictionary of substitutions the parser needs to make.


More information about the Digitalmars-d-learn mailing list