Random algorithm

Malte Brill revolution at derbrill.de
Thu Nov 13 02:36:31 EST 2008


Dave wrote:

 > The  maximum number it can be set to seems to be 2130706432.

Hi Dave (and all)

I am not too sure about that, though I would love to know if there are  
upper limits. On my Intel mac I get:

9
4
34
30
25
21
16
12
8
3
33

on each run of the following script:

on mouseUp pMouseBtnNo
     repeat with i= 2130706432 to 2130706442
         set the randomseed to i
         put random(34) & cr after fld 1
     end repeat
end mouseUp

So it does not appear to be upper limited at 2130706432. Given the  
game writers perspective to this, I really like the way the random  
algorithm the way it is implemented in Revolution, as a seeded  
algorithm can be used in many ways in games. It prevents the ability  
to cheat with undo systems in casual games, or even lets you set up  
whole galaxies without stuffing memory.

Cheers,

Malte




More information about the use-livecode mailing list