A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: I doubt anyone will answer this

  1. #1
    Senior Member
    Join Date
    Nov 2000
    Location
    Allentown PA
    Posts
    350

    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
    http://www.Freq-Fest.com

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397

  3. #3
    Senior Member vucjak's Avatar
    Join Date
    Mar 2002
    Location
    BanjaLuka, RS, Bosnia
    Posts
    306
    lol

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center