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) & "|"

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

While 1

Func _add()
    Local $x
        $x = Random(1, UBound($aArray) - 1, 1)
        While $sda.Exists($x)
            $x = Random(1, UBound($aArray), 1)
    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()


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...