Very, Very Complex Array!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cindy2
    New Member
    • Sep 2007
    • 35

    Very, Very Complex Array!!!

    Hi, I have a VERY complex problem.

    I need a 2D array with x*x elements. There are two cases:

    1) 4 <= x < 8
    2) 8 <= x <= 10

    Case 1)

    Every COLUMN of the array must be randomly filled with the letters a, b, c and d. Each column can only have each letter one time. If x is bigger than 4, then the vacancies of each column must be filled with k's (as many as necessary).
    Also it's not allowed to have 2 k's one after the other in a ROW.

    Case 2)

    Every COLUMN of the array must be randomly filled with the letters a, b, c, d, e, f, g and h. Each column can only have each letter one time. If x is bigger than 8, then the vacancies of each column must be filled with k's (as many as necessary).
    Also it's not allowed to have 2 k's one after the other in a ROW.


    Does anybody know how I can make this very complex array?

    Cindy
    Last edited by cindy2; Sep 20 '07, 02:57 PM. Reason: forgot a "=" character
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    To make the array is simple, just define it
    dim arr(x, x) as string
    and you're done.

    Now, to fit your requirements, I'll strongly recomend you to post your problem in the games & puzzles forum, I think Rabbit will solve it in a couple of minutes, after that you'll only have to write the code.

    If what you want is a code that solves it, I think it's quite similar to the 8 queens puzzle,

    HTH

    Comment

    Working...