Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted (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 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.
Posted (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 by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Posted

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

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

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Posted

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.

Posted (edited)

How How How???

You have two variables with the same name. Rename one of them.

Edited by Read
Posted

you are really not going to explore the helpfile, or even try? you should change your name to "not going to read".. .

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Posted

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

Posted (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 by Read
Posted (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 by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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