By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,967 Members | 1,690 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,967 IT Pros & Developers. It's quick & easy.

Very, Very Complex Array!!!

cindy2
P: 35
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
Sep 20 '07 #1
Share this Question
Share on Google+
1 Reply


kadghar
Expert 100+
P: 1,295
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
Sep 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.