-
I doubt anyone will answer this
Here's what I want to do:
First screen:
A user inputs the number of words they'd like to enter
2nd screen:
The user inputs the words
3rd screen:
We display EVERY combination of those words (aka - permutation / lexicographical ordering)
So if the user puts in:
one two three
The final screen displays:
one two three
two one three
two three one
three two one
three one two
one three two
At the moment I have a huge mess for my code but here it is if your interested:
for (scram=1; scram<=totalWords; scram++) {
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
for (temp=1; temp<=totalWords; temp++) {
set("tempWord"+temp, placeholder["word"+temp]);
}
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
moveWord = eval("tempWord"+scram);
// ---------------------------------------
for (huh=1; huh<=totalWords; huh++) {
if (huh<scram) {
for (grr=(huh+1); grr<=totalWords; grr++) {
set("tempWord"+grr, placeholder["word"+huh]+"u ");
}
}
if (huh>scram) {
for (grr=(huh-1); grr<=totalWords; grr++) {
set("tempWord"+grr, placeholder["word"+huh] + "o ");
}
}
set("tempWord"+huh, moveWord);
// --- CREATE SENTANCE ---
for (sent=1; sent<=totalWords; sent++) {
sentance = sentance+eval("tempWord"+sent);
}
final = final+sentance+"\r";
sentance = "";
}
}
Thanks in Advance
Frequent-C
http://www.Freq-Fest.com
-
-
Senior Member
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|