Renderer Posted August 10, 2016 Posted August 10, 2016 Hello guys! I got myself locked up trying to solve a problem.How can i generate random natural numbers using ciphers from an array. For example: I have this array: $cipher[10] = [1,2,3,4,5,6,7,8,9,0] How could I make the script randomly generate the 5943 number?
Moderators JLogan3o13 Posted August 10, 2016 Moderators Posted August 10, 2016 @Renderer are you talking something like this? #include <Array.au3> Local $cipher[10] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] Local $a = Random(_ArrayMin($cipher), _ArrayMax($cipher), 1) Local $b = Random(_ArrayMin($cipher), _ArrayMax($cipher), 1) Local $c = Random(_ArrayMin($cipher), _ArrayMax($cipher), 1) Local $d = Random(_ArrayMin($cipher), _ArrayMax($cipher), 1) ConsoleWrite($a & $b & $c & $d & @CRLF) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Renderer Posted August 10, 2016 Author Posted August 10, 2016 1 hour ago, JLogan3o13 said: @Renderer are you talking something like this? #include <Array.au3> Local $cipher[10] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] Local $a = Random(_ArrayMin($cipher), _ArrayMax($cipher), 1) Local $b = Random(_ArrayMin($cipher), _ArrayMax($cipher), 1) Local $c = Random(_ArrayMin($cipher), _ArrayMax($cipher), 1) Local $d = Random(_ArrayMin($cipher), _ArrayMax($cipher), 1) ConsoleWrite($a & $b & $c & $d & @CRLF) Yeah ! Something like this! Thanks!
jchd Posted August 10, 2016 Posted August 10, 2016 Isn't that the same as: #include <Array.au3> ; Local $cipher[10] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] ; is that a cipher? Really? Local $a = Random(0, 9, 1) Local $b = Random(0, 9, 1) Local $c = Random(0, 9, 1) Local $d = Random(0, 9, 1) ConsoleWrite($a & $b & $c & $d & @CRLF) 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)
Renderer Posted August 12, 2016 Author Posted August 12, 2016 Is there any way to mix them with letters? Like 1A , 3B , 31E>
Moderators JLogan3o13 Posted August 12, 2016 Moderators Posted August 12, 2016 Yes, there is. What have you tried on your own? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Danyfirex Posted August 13, 2016 Posted August 13, 2016 Hello Just for Fun Global Const $ASCII_A=0x41 Global Const $ASCII_Z=0x5A For $i=1 to 100 ConsoleWrite(Random(1,99,1) & Chr(Random($ASCII_A,$ASCII_Z,1)) & @CRLF) Next Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
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