Results 1 to 3 of 3

Thread: [2008] Need help on permutatoin

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2008
    Posts
    95

    [2008] Need help on permutatoin

    Hi

    I am looking for trifecta permutation combination code.
    I mean if i give any number like 1 5 6 or 8 9 7 4 3

    the program should print all possible combination in trifecta format
    so if i give 3 numbers it should print 6 combinatin if i give 4 numbers it should give 24 combination n so on.

    Please help
    Thanks

  2. #2

  3. #3
    Fanatic Member
    Join Date
    Aug 2006
    Location
    In my head
    Posts
    913

    Re: [2008] Need help on permutatoin

    I had a function built for this specific purpose, when Vista Ultimate went up 2 weeks ago, I lost it - backup hadnt been working.

    Anywhoodles, the gist of it is that you have to break the string down into a string (or char) array (this forgoes the need to see how long the string is). Then use for loops (yes there will be more than one) to run through your string.
    Put the results in a List(Of String) and make sure to check for duplicates BEFORE you add them, because if you have a string that contains the same digit more than once, you WILL get duplicates. If that really does not matter in your results then don't worry about it.

    Hopefully that points you in the right direction......

    D
    Platforms of choice: Visual Studio 2005/2008 Professional : Visual Studio 2010 Enterprise : PHP - Notepad++/WAMP

    Please Rate If I helped you.
    Please remember to mark threads as closed if your issue has been resolved.

    Reserved Words in Access | Connection Strings

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