Results 1 to 4 of 4

Thread: Permutations

  1. #1

    Thread Starter
    Fanatic Member Gandalf_Grey_'s Avatar
    Join Date
    Oct 2001
    Location
    the 42nd dimension
    Posts
    665

    Permutations

    What, do you guys think, is the best way to arrange 7 aribtrary letters in all of thier combinations and enter them into an array or compare them to an array.

    i want to loop through each of these combinations, and then compare it to an array of 4000 elements to see if there are any matches

    P.S. there are 8031810176 combinations

  2. #2
    Member
    Join Date
    Nov 2001
    Location
    Birmingham UK
    Posts
    49
    Thats gonna take a long time to loop through!!

  3. #3

    Thread Starter
    Fanatic Member Gandalf_Grey_'s Avatar
    Join Date
    Oct 2001
    Location
    the 42nd dimension
    Posts
    665
    well I was wondering if there was a faster way to do it than just looping through all of the possible combinations

  4. #4
    Member
    Join Date
    Nov 2001
    Location
    Birmingham UK
    Posts
    49
    You could do it a bit like the mastermind game, if it finds that a particular letter never occurs in a position then skip that part of the loop.

    eg

    (4000 matches)
    DJEMLSJ
    HSYEKDM
    etc....

    (7 aribtrary letters)
    AKTNDO

    (loop starts with A in position 1)

    A******

    if A does not occur in position 1 for any of the 4000 matches then skip looping though the combinations with A in position 1.


    Hope that makes sense - it just an idea, ive probably miss-understood!

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