MvGulik Posted February 28, 2010 Share Posted February 28, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
trancexx Posted February 28, 2010 Share Posted February 28, 2010 If you want to generate numbers from 0 to 2^32 and want every number to be generated only once (that's the expression) the fastest way, by far, is to simply start with 0 and add 1 to every new number, even if that seems too obvious. Regardless of that smiley, I'm serious. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
martin Posted February 28, 2010 Share Posted February 28, 2010 (edited) If you want to generate numbers from 0 to 2^32 and want every number to be generated only once (that's the expression) the fastest way, by far, is to simply start with 0 and add 1 to every new number, even if that seems too obvious. Regardless of that smiley, I'm serious. Exactly, but I assume MvGulik didn't say what he meant. If he wants a random number in a range which is never repeated then here is a way $n = 4;how big the largest number should be Dim $aN[2 ^ $n + 1] For $a = 1 To 2 ^ $n $aN[$a] = $a Next For $a = 2 ^ $n To 2 Step -1 $element = Random(1, $a, 1) $nextnumber = $aN[$element] ConsoleWrite($nextnumber & @CRLF) $aN[$element] = $aN[$a] Next $nextnumber = $aN[1] ConsoleWrite($nextnumber & @CRLF) That way there is never any need to check that you have a duplicate. But for the range you say you want I would think of getting another job. Edited February 28, 2010 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
MvGulik Posted February 28, 2010 Author Share Posted February 28, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
jchd Posted February 28, 2010 Share Posted February 28, 2010 This is rather a pseudo-random permutation of the numbers 1..232Not the same guy! 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 hereRegExp tutorial: enough to get startedPCRE 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) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now