Actually, permutation is your friend... and there are tons of code samples
and algorithms out there. I'd start here.
http://www.google.com/search?hl=en&client=firefox-a&channel=s&rls=org.mozill
a%3Aen-US%3Aofficial&hs=mXk&q=permutation+coldfusion&btnG=Search
..:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfie
Hey that's pretty smooth. I appreciate it!!
On Thu, Feb 14, 2008 at 1:27 PM, Jeff Price <[EMAIL PROTECTED]> wrote:
> Try this chunk of code. I leave it up to you to add in a remove duplicates
> feature. Check cflib.org for some handy functions to do that.
>
> NOTE: I found it easier to build a l
Try this chunk of code. I leave it up to you to add in a remove duplicates
feature. Check cflib.org for some handy functions to do that.
NOTE: I found it easier to build a list instead of an array simply because I
could recurse with ListAppend but if I recurse with ArrayAppend it starts
making
You could use a database for this. Create
>> a table that contains a single column. That column contains a record for
>> each letter of the alphabet. Then, do a cartesian join to join that table
>> to itself, three other times. Concatenate the fields and you should have
>> each combination.
>>
e to
> itself, three other times. Concatenate the fields and you should have each
> combination.
> >>
> >> That would get the first part without consideration of the second part.
> >>
> >> m!ke
> >>
> >> _
> >>
>
_
>>
>> From: Greg Morphis [mailto:[EMAIL PROTECTED]
>> Sent: Wed 2/13/2008 4:57 PM
>> To: CF-Talk
>> Subject: all possible letter combinations
>>
>>
>>
>>
>> Given a string, e.g. "ABCD"
>>
>> I need to come u
_
>
> From: Greg Morphis [mailto:[EMAIL PROTECTED]
> Sent: Wed 2/13/2008 4:57 PM
> To: CF-Talk
> Subject: all possible letter combinations
>
>
>
>
> Given a string, e.g. "ABCD"
>
> I need to come up with all combinations of letters
> eg
> ABCD
>
each combination.
That would get the first part without consideration of the second part.
m!ke
_
From: Greg Morphis [mailto:[EMAIL PROTECTED]
Sent: Wed 2/13/2008 4:57 PM
To: CF-Talk
Subject: all possible letter combinations
Given a string, e.g. "ABCD"
I need to come u
This is what I have so far..
if(len(remainingchars) eq 1) {
wordArray[ArrayLen(wordArray)+1] = strbase &
mid(remainingchars,1,1);
} else {
for (j = 1; j lt len(remainingchars); j=j+1) {
What have you got so far?
Mark
On Feb 14, 2008 10:58 AM, Greg Morphis <[EMAIL PROTECTED]> wrote:
> yes, I know that and it's that part that I need help with which is why
> I posted here.
> Thanks
>
> On Feb 13, 2008 5:34 PM, Mark Mandel <[EMAIL PROTECTED]> wrote:
> > Recursion is your friend ;o)
yes, I know that and it's that part that I need help with which is why
I posted here.
Thanks
On Feb 13, 2008 5:34 PM, Mark Mandel <[EMAIL PROTECTED]> wrote:
> Recursion is your friend ;o)
>
> Mark
>
>
> On Feb 14, 2008 9:57 AM, Greg Morphis <[EMAIL PROTECTED]> wrote:
> > Given a string, e.g. "ABCD
Recursion is your friend ;o)
Mark
On Feb 14, 2008 9:57 AM, Greg Morphis <[EMAIL PROTECTED]> wrote:
> Given a string, e.g. "ABCD"
>
> I need to come up with all combinations of letters
> eg
> ABCD
> ABDC
> ACBD
> ACDB
>
>
> And exlude strings like '', 'AAAB' unless you pass a string with
Given a string, e.g. "ABCD"
I need to come up with all combinations of letters
eg
ABCD
ABDC
ACBD
ACDB
And exlude strings like '', 'AAAB' unless you pass a string with
duplicate characters
If I pass the string "AAAB" then it'd return:
AAAB
AABA
ABAA
BAAA
~
13 matches
Mail list logo