: 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
ABDC
ACBD
ACDB
.
And exlude strings like '', 'AAAB' unless you pass a string with
duplicate characters
If I
that table 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
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
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
ABDC
ACBD
ACDB
.
And exlude strings like '', 'AAAB' unless you pass a string with
duplicate characters
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
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 list
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=enclient=firefox-achannel=srls=org.mozill
a%3Aen-US%3Aofficialhs=mXkq=permutation+coldfusionbtnG=Search
..:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
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
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
I need
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
duplicate
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)
Mark
This is what I have so far..
cffunction name=createWordList returntype=array
cfargument name=wordArray required=yes type=array /
cfargument name=strbase default= required=yes type=string /
cfargument name=remainingchars default= required=yes
type=string /
cfset var j
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 up with all
13 matches
Mail list logo