Sign in to follow this  
Followers 0
GodForsakenSoul

true randomization

6 posts in this topic

the only form of random number gen i can think of is.

dim $n
$n=Random(1,10,1)

and even that is not exactly random because most of the hits are 1-5. once in a while i get more.

is there anything more random then Random()? (see what i did there? ;D)

Share this post


Link to post
Share on other sites



Hi,

as you can see:

#include <array.au3>

Dim $arrandom [11] [2]
For $i = 1 To 10
    $arrandom [$i] [0] = $i
    $arrandom [$i] [1] = 0
Next
$count = 0
While $count <= 100000
    $n=Random(1,10,1)
    $arrandom [_ArraySearch ($arrandom, $n)] [1] = $arrandom [_ArraySearch ($arrandom, $n)] [1] + 1
    $count += 1
WEnd
_ArrayDisplay ($arrandom)

i will get at least about 10000 for each number.

;-))

Stefan

Share this post


Link to post
Share on other sites

How random does it need to be? You could record the mouse movements of the user, I guess that's the closest to true randomization there is. (this method is also used by Putty)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

the only form of random number gen i can think of is.

dim $n
$n=Random(1,10,1)

and even that is not exactly random because most of the hits are 1-5. once in a while i get more.

is there anything more random then Random()? (see what i did there? ;D)

Random() is good. You are interpreting something wrong when you say that.

Run this to see how 'random' is Random():

#include <Array.au3>

Global $iNum
Global $aArray[11]


For $i = 1 To 200000
    $iNum = Random(0, 10, 1)
    $aArray[$iNum] += 1
Next

_ArrayDisplay($aArray)

Question is what do you see when that array is displayed to you.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

How random does it need to be? You could record the mouse movements of the user, I guess that's the closest to true randomization there is. (this method is also used by Putty)

as random as possible. there will be not much mouse moves... i think...

also, i don't know how to record mouse movements XD;;

Share this post


Link to post
Share on other sites

as random as possible. there will be not much mouse moves... i think...

also, i don't know how to record mouse movements XD;;

Of course, replace "random" by pseudo-random everywhere.

AFAIK the algorithm implemented by AutoIt Random() is excellent and passes whatever test you need for layman applications.

OTOH if you feel you need cryptographic-level pseudo-random input, then rely on proven layers. But do you really need that?

I wouldn't bet my life (nor yours) on how "random" mice movements can be. That's in my view a very bad choice compared to a well know algorithm with proven track record and demonstrated properties.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0