Hey. I'm looking to devise a way of getting a list of numbers that looks random, but which returns the same list every time it is run.
I'm a little unsure how the rnd and rand commands work. Do they rely upon some sort of bank of numbers that is burned into a chip somewhere on the motherboard, coupled with whatever number you seed it with? (Usually milliseconds.)
The reason I ask is because I need a reliable way to make stuff LOOK random but not actually BE random. One method I considered is this:
When I run this on my computer, it ALWAYS produces the same 10 numbers. BUT. I don't just want it to do this on my computer. I want a program that will produce the same ten numbers on EVERYONE'S computer.
If BlitzBasic's random number generator draws non-seed variables from internal code, then this code (when compiled into an exe) should produce the exact same output on every computer it's run on.
On the other hand, if it hashes the seed number with a list of numbers on a chip, then each computer model will work differently. It means that some computers will return the same "random" numbers as my computer, while other brands or models of computer parts will do all kinds of different things with that "SeedRnd 1" command.
Can anyone tell me whether Blitz's random numbers are software-encoded or derived from hardware on the computer?
And would somebody please run the above code and tell me what numbers the program outputs. On my computer, it's always:
3
7
9
7
0
2
3
1
1
6
If we all get the same numbers from "SeedRnd 1," then it means it'll be easy to do what I want to do. If not... :/ Then I'll have to write my own txt file full of "random" numbers and figure out how to hash it manually.
Thanks in advance for your help! :)
I'm a little unsure how the rnd and rand commands work. Do they rely upon some sort of bank of numbers that is burned into a chip somewhere on the motherboard, coupled with whatever number you seed it with? (Usually milliseconds.)
The reason I ask is because I need a reliable way to make stuff LOOK random but not actually BE random. One method I considered is this:
SeedRnd 1 For x=1 To 10 num=Rnd (10) Print num Next
When I run this on my computer, it ALWAYS produces the same 10 numbers. BUT. I don't just want it to do this on my computer. I want a program that will produce the same ten numbers on EVERYONE'S computer.
If BlitzBasic's random number generator draws non-seed variables from internal code, then this code (when compiled into an exe) should produce the exact same output on every computer it's run on.
On the other hand, if it hashes the seed number with a list of numbers on a chip, then each computer model will work differently. It means that some computers will return the same "random" numbers as my computer, while other brands or models of computer parts will do all kinds of different things with that "SeedRnd 1" command.
Can anyone tell me whether Blitz's random numbers are software-encoded or derived from hardware on the computer?
And would somebody please run the above code and tell me what numbers the program outputs. On my computer, it's always:
3
7
9
7
0
2
3
1
1
6
If we all get the same numbers from "SeedRnd 1," then it means it'll be easy to do what I want to do. If not... :/ Then I'll have to write my own txt file full of "random" numbers and figure out how to hash it manually.
Thanks in advance for your help! :)