[Flashcoders] Whats the deal with AS3 Math.random?

2006-11-27 Thread Sascha
Hi, Why is it when I use Math.random to generate 10 random integers I get the same pattern of numbers almost every time. Starting the SWF movie ten times and I have 6-8 times the same pattern of numbers. What's going on there? Almost looks as if the compiler sets pre-compiled numbers. Using this

Re: [Flashcoders] Whats the deal with AS3 Math.random?

2006-11-27 Thread Ron Wheeler
Math.random generates psuedo-random numbers. If you want to have something that looks more random, try calling Math.random a random number of times before using the numbers. Use a true random number to determine the number of times to call it in the initial run. Suggestion: the modulus 100 of

RE: [Flashcoders] Whats the deal with AS3 Math.random?

2006-11-27 Thread Danny Kodicek
Hi, Why is it when I use Math.random to generate 10 random integers I get the same pattern of numbers almost every time. Starting the SWF movie ten times and I have 6-8 times the same pattern of numbers. What's going on there? Most randomisation algorithms are based on a 'seed' value

RE: [Flashcoders] Whats the deal with AS3 Math.random?

2006-11-27 Thread Merrill, Jason
-Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Ron Wheeler Sent: Monday, November 27, 2006 9:45 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Whats the deal with AS3 Math.random? Math.random generates psuedo-random numbers. If you want

RE: [Flashcoders] Whats the deal with AS3 Math.random?

2006-11-27 Thread Sascha
-Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Ron Wheeler Sent: Monday, 27 November, 2006 23:45 To: Flashcoders mailing list Subject: Re: [Flashcoders] Whats the deal with AS3 Math.random? Math.random generates psuedo-random numbers. If you

Re: [Flashcoders] Whats the deal with AS3 Math.random?

2006-11-27 Thread Jon Bradley
And yet another random number generator library (was posted at were- here.com a long long time ago). All open source, credit for use is nice though. :) This one is a linear congruential generator. I've never tested the output against anything, so at best, this may or may not work properly