Jump to content

Recommended Posts

In what circumstance the array will not grow returning the same count of elements (ALT+w) to fire it up

perhaps using $sda.Exists wrongly
#include <Array.au3>

HotKeySet("!w", "_add")
HotKeySet("{ESC}", "Terminate")

Local $s
For $i = 1 To 1010
    $s &= Number($i + 1, 1) & "|"
Next

Global $aArray = StringSplit(StringTrimRight($s, 1), "|"), $icount = 100 ,$sda = ObjCreate("Scripting.Dictionary")
$sda.Item(0)

While 1
    Sleep(10)
WEnd


Func _add()
    Local $x
    Do
        $x = Random(1, UBound($aArray) - 1, 1)
        While $sda.Exists($x)
            $x = Random(1, UBound($aArray), 1)
        WEnd
        $sda.Item($aArray[$x])
    Until Not Mod(($sda.Count - 1), $icount)

    $aResult = $sda.Keys()
    $aResult[0] = UBound($aResult) - 1

    _ArraySort($aResult, 0, 1)
    _ArrayDisplay($aResult, "Unique")
EndFunc   ;==>_add

Func Terminate()
    Exit
EndFunc

 

Edited by Deye
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...