Read Posted May 11, 2012 Posted May 11, 2012 I have six numbers and how to make combinations? Example: Numbers: 01 02 03 04 05 06 Now must make a combinations: 01, 02, 03, 04, 05 01, 02, 03, 04, 06 01, 02, 03, 05, 06 01, 02, 04, 05, 06 01, 03, 04, 05, 06 02, 03, 04, 05, 06 We must use array: 16 23 34 36 37 44 13 17 26 30 32 38 and to make of combinations... Very thanks
jdelaney Posted May 11, 2012 Posted May 11, 2012 look into _arraypermute and _arraycombinations, or please explain your issue a bit more... IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Read Posted May 11, 2012 Author Posted May 11, 2012 My English is not good. Array: 01 02 03 04 05 06 And make of combinations... 01 02 03 04 05 06 result: 01, 02, 03, 04, 05 01, 02, 03, 04, 06 01, 02, 03, 05, 06 01, 02, 04, 05, 06 01, 03, 04, 05, 06 02, 03, 04, 05, 06 Combinations save in .txt file.
jdelaney Posted May 11, 2012 Posted May 11, 2012 (edited) there is nothing to understand, run it #include <Array.au3> Local $aArray[6] = ["01","02","03","04","05","06"] Local $aNewArray = _ArrayPermute($aArray, ",") ;Using Default Parameters _ArrayDisplay($aNewArray, "Array Permuted") Edited May 11, 2012 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
iamtheky Posted May 11, 2012 Posted May 11, 2012 (edited) Cant understand... Then this might not help either, but dumping this array to a txt file looks similar to your expected result #include<array.au3> Local $aArray[6] = ["01","02","03","04","05","06"] Local $aNewArray = _ArrayCombinations($aArray, 5 , ",") _ArrayDisplay($aNewArray, "Array Combos") Edited May 11, 2012 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Read Posted May 11, 2012 Author Posted May 11, 2012 Now is correct but i add more line and not work anymore. #include<array.au3> Local $aArray[6] = ["01","02","03","04","05","06"] Local $aArray[6] = ["7","9","18","19","35","40"] Local $aNewArray = _ArrayCombinations($aArray, 5 , ",") _ArrayDisplay($aNewArray, "Array Combos")
iamtheky Posted May 11, 2012 Posted May 11, 2012 #include<array.au3> Local $aArray[6] = ["01","02","03","04","05","06"] _ArrayDisplay($aArray, "Array Combos") Local $aArray[6] = ["7","9","18","19","35","40"] _ArrayDisplay($aArray, "Array Combos") You are not doing what you intend. Read the helpfile. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
somdcomputerguy Posted May 12, 2012 Posted May 12, 2012 Now is correct but i add more line and not work anymore. #include<array.au3> Local $aArray[6] = ["01","02","03","04","05","06"] Local $aArray[6] = ["7","9","18","19","35","40"] Local $aNewArray = _ArrayCombinations($aArray, 5 , ",") _ArrayDisplay($aNewArray, "Array Combos") You have two variables with the same name. Rename one of them. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Read Posted May 12, 2012 Author Posted May 12, 2012 (edited) How How How???You have two variables with the same name. Rename one of them. Edited May 12, 2012 by Read
iamtheky Posted May 12, 2012 Posted May 12, 2012 you are really not going to explore the helpfile, or even try? you should change your name to "not going to read".. . ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Read Posted May 12, 2012 Author Posted May 12, 2012 I'm not programmer and don't understand this language.
kylomas Posted May 12, 2012 Posted May 12, 2012 Read,I'm not programmer and don't understand this language.This would beg the question, "why are you doing this?".To get help you need to provide examples of what you expect, what is happenning/not happening, and, whatever code you have written.kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
Read Posted May 12, 2012 Author Posted May 12, 2012 (edited) hmm #include<array.au3> Local $aArray[6] = [("01","02","03","04","05","06")|("7","9","18","19","35","40")] Local $aNewArray = _ArrayCombinations($aArray, 5 , ",") _ArrayDisplay($aNewArray, "Array Combos") Edited May 12, 2012 by Read
somdcomputerguy Posted May 12, 2012 Posted May 12, 2012 (edited) You have two variables with the same name. Rename one of them. How How How??? #include<array.au3> Local $aArray[6] = ["01","02","03","04","05","06"] Local $aArray[6] = ["7","9","18","19","35","40"] Local $aNewArray = _ArrayCombinations($aArray, 5 , ",") _ArrayDisplay($aNewArray, "Array Combos") #include<array.au3> Local $aArray[6] = ["01","02","03","04","05","06"] Local $bArray[6] = ["7","9","18","19","35","40"] ; this array is not named the same as the one before it! Local $aNewArray = _ArrayCombinations($aArray, 5 , ",") _ArrayDisplay($aNewArray, "Array Combos") See the difference? Perhaps I confused you by calling an array a variable.. Edited May 12, 2012 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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