[] > :put "Generated random string $[$randomstr] and generated random number $[$randomnum]"
Generated random string 90 and generated random number 23
[] > :put "Generated random string $[$randomstr] and generated random number $[$randomnum]"
Generated random string 47 and generated random number 78
[] > :put "Generated random string $[$randomstr] and generated random number $[$randomnum]"
Generated random string 81 and generated random number 3
[] > :put "Generated random string $[$randomstr] and generated random number $[$randomnum]"
Generated random string 27 and generated random number 58
[] > :put "Generated random string $[$randomstr] and generated random number $[$randomnum]"
Generated random string 59 and generated random number 89
[] > :put "Generated random string $[$randomstr] and generated random number $[$randomnum]"
Generated random string 05 and generated random number 39
The CPU can have the same load all the time,
so you would never get such different numbers,
but they would always fluctuate in the usual range like 9/10/9/10/11/9/10… etc.
Yes, on your example, 3 times “2” and 2 times “11”, and 2 times very close to the 2 (“3” and “4”)
If they are random it could happen, even once in a million, if not more, that the same number comes out 10 times in a row and over…
Why not?
But obviously one thing is the randomness, one thing is an excessive tendency to give the same numbers…
You’re playing with “loaded” dice using the CPU. Do you really want 99 to come up as the random number?
But yes it is one line, but do think you’ll get “more randomness” from IRQ. But, yes its more lines of code.
This is why libraries for RSC are hard – everyone has difference preferences. If I actually had a need for a random number, in V6, and had internet… /tool/fetch to random.org would be even “more random”. Depending on ones formatting preferences, that could be one-line too.
I slightly changed the function of Rex’a and now I observe a strange thing: everything works from the terminal, but not from the script. :put [$randomnum] works, but log info [$randomnum] does not output anything… What’s the matter?