Results 1 to 2 of 2

Thread: Coming up with 256 Permutations?

Hybrid View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2007
    Posts
    1,072

    Coming up with 256 Permutations?

    I need to come up with an array of 256 permutations for this project I'm working on.



    I need an array of:
    Code:
    xxxx xxxx
    xxxx oxxx
    xxxx ooxx
    xxxx ooox
    xxxx oooo
    .........
    oxxx xxxx
    oxxx oxxx
    oxxx ooxx
    oxxx ooox
    oxxx oooo
    .........
    I know I can do this with 8 nested For Loops but I'm curious if there is another way! Thank you!

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2007
    Posts
    1,072

    Re: Coming up with 256 Permutations?

    I guess this works:
    Code:
            Dim Options() As String = {"xxxx", "oxxx", "ooxx", "ooox", "oooo", "xooo", "xxoo", "xxxo", "oxxo", "ooxo", "xoxo", "xoxx", "xoox", "xxox", "oxox", "oxoo"}
            For x As Integer = 0 To 15
                For y As Integer = 0 To 15
                    Debug.Print(Options(x) & " " & Options(y))
                Next
            Next
    Still curious as to other solutions

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