4 posts in this topic
This topic is now closed to further replies.
Hi Guys and Gals,
I'm attempting to write a script that will give me an output of all the possible combinations of a predifined set. For example I have five letters "P, K, R, A, W" that I want to run through and get every last combination from it.
Such as if I had then numbers 0, 1, 2 and a 3 digit combination I would have Twenty Seven different outcomes ranging from 000, 001 - 221, 222.
I wouldn't have a problem if I were ok with having repeated outcomes or writing a long list of code but I do not want repeats and I want to eventually set up a GUI based system to accept Alpha & Alphanumeric characters of any length and do what I am looking for now.
This is the basic layout I have:
#include <GUIConstantsEx.au3> #include <Array.au3> #include <StaticConstants.au3> Const $title = "Combinator" Global $wX = 300, $wY = 25 Local $array = ["P", "K", "R", "A", "W"] GUICreate($title, $wX, $wY) GUICtrlCreateLabel("COMBINATIONS", 5, 5, $wX - 10, $wY - 10, $SS_CENTER) GUISetState() While 1 $msg = GUIGetMsg() Select case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func _generate() ;Combo Loop Sleep(5000) ;Allow Time to See Combination EndFunc