TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Randomization

Page: 1 Reply
Aug 26th 2003#119046 Report
Member since: Dec 24th 2001
Posts: 222
I was wondering if someone could point me towards a reference to the randomization algorithm used in flash to create random numbers. I must gather this information for an experiment of mine so any help would be appreciated...if this cannot be found then if someone could provide me with the same information for the javascript random command it would be equally appreciated.
Reply with Quote Reply
Aug 26th 2003#119051 Report
Member since: Nov 26th 2001
Posts: 2586
Actionscript (Flash):
Math.random() ---> its a built in math function.

I'm not sure about Actionscript, but random functions usually generate a number from 0 to 1, so you put it in a formula to get a random number of values between what your min and max possible values are.
Reply with Quote Reply
Aug 27th 2003#119207 Report
Member since: Dec 24th 2001
Posts: 222
well there are two functions one is math.random() which generates a number between 0 and 1 and then there is random(integer) which creates a random number between 0 and one less then the integer provided. i understand the functions but somewhere in flash there is an algorithm used to randomize numbers which probably manipulates itself based on the computer clock and so im just looking for a site or something that gives this algorithm. i read about javascript's random() function once but lost my source and i need the reference for flash and actionscript. so from that perspective can anyone help me?
Reply with Quote Reply
Aug 27th 2003#119259 Report
Member since: Aug 9th 2001
Posts: 2333
i already posted how i did this not so long ago, only 1 line long. Have a look/search in this section
Reply with Quote Reply
Aug 28th 2003#119281 Report
Member since: Dec 24th 2001
Posts: 222
did what? im just looking for a fact. im not trying to compute anything, and i dont need help scripting, i just need to know what flash does to randomize things.
Reply with Quote Reply
Aug 28th 2003#119283 Report
Member since: Nov 26th 2001
Posts: 2586
hmmmm ... I checked google and also www.macromedia.com and didnt find anything regarding what you are asking. Just out of curiosity, what do you need to know the algorithm for?
Reply with Quote Reply
Aug 28th 2003#119286 Report
Member since: Dec 24th 2001
Posts: 222
im doing a science fair project that involves generating random numbers to see out of a million trials will there be about 50% 0's and 50% 1's out of 0's and 1's and i need to know what does it.
Reply with Quote Reply
Aug 28th 2003#119290 Report
Member since: Aug 9th 2001
Posts: 2333
Oh my apologies. Don't know how it works...i used math.random() to get a random number.
Reply with Quote Reply
Aug 28th 2003#119313 Report
Member since: Nov 26th 2001
Posts: 2586
Maybe try looking into some of the encryption algorithms, like md5? You can see how they work on their sites....
Reply with Quote Reply
Aug 28th 2003#119331 Report
Member since: Aug 9th 2001
Posts: 2333
Ask the same question at ultrashock's actionscript forum?
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum