I guess my question was a little broad. Let me refine it.
For example, were I to generate random intervals between 1 and 10 seconds long (inclusive) doing this:
. . . can I expect the distributions to "look" really random? (In 100 loops, can I expect to see about 10 of each value in each category of 1 second, 2 seconds . . . 10 seconds, etc.?) And, in the sequence, will I see a discernable pattern?Code:SEED=32771 LOOP: RANDOM SEED TIME=(SEED//10)+1 TIME=1000*TIME HIGH LED PAUSE TIME LOW LED PAUSE 1000 GOTO LOOP END
In some small BASIC implementations, I've had to do the equivalent of this:
. . . in order to get good distributions of small numbers.Code:SEED=32771 LOOP: RANDOM SEED TIME=(SEED//11)+1 IF TIME<2 OR TIME>10 THEN GOTO LOOP TIME=1000*TIME HIGH LED PAUSE TIME LOW LED PAUSE 1000 GOTO LOOP END





Bookmarks