randomseed
Posted: Sat Apr 21, 2012 5:43 am
This topic came up in the thread on opening random cards. I am putting my query in the beginner section because that is how I feel right now.
It was mentioned that the randomseed is, unless meddled with, fixed for any session, which is true. it was asserted that a string of random numbers generated with this seed would indeed be random, but also that this string would be the same for each call using that seed. The dictionary confirms this.
I have never seen this behavior. In a button script with a "field 1" available somewhere:
Now, the randomseed stays the same, as advertised, but the string developed in each iteration is different, as my 25 years of experience using this function has always shown. It never occurred to me to have to worry about it. I understand changing the randomseed to increase the "randomness" of the function itself. What do I not understand about the assertion? What script would in fact generate a string of identical random numbers, over and over?
Craig Newman
It was mentioned that the randomseed is, unless meddled with, fixed for any session, which is true. it was asserted that a string of random numbers generated with this seed would indeed be random, but also that this string would be the same for each call using that seed. The dictionary confirms this.
I have never seen this behavior. In a button script with a "field 1" available somewhere:
Code: Select all
on mouseUp
put "" into fld 1
repeat with y = 1 to 20
put the randomseed & return after fld 1
repeat 10
put random(10) after temp
end repeat
put temp & return after fld 1
put "" into temp
end repeat
end mouseUp
Craig Newman