[Gambas-user] Randomize

P. Mountstevens perrymou at ...370...
Fri Jul 14 11:23:17 CEST 2006


On Tuesday 11 July 2006 22:16, Leonardo Miliani wrote:

> >> Is it possible to setup the random numbers generator with a seed?
> >> In other languages this is done by randomize (x) where x is the seed.
> >> Using this command, you are sure that the generator provides the same
> >> numbers every time it is set up with the same seed.
> >> This is useful for example in cryptography, where you can add more
> >> security to a public key using a seed to interpolate the public key bits
> >> with random numbers to obtain any time differents encryptions of same
> >> datas and same keys.
>   

Easy:


a=12 '(where 12 is the number you wish to seed from)

for b= 1 to a
c=rnd
next

mynumber=rnd






		
___________________________________________________________ 
Inbox full of spam? Get leading spam protection and 1GB storage with All New Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html





More information about the User mailing list