473,396 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Very Complex Array in VB2005

cindy2
35
Hi, I have a VERY complex problem. I have posted it under Forums/Visual Basic, but I was strongley recommended to post it here.

In VB2005 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 randomly filt 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 vacanies of each column must be filt with k 's (as many as nescesary).
Also it's not alloud to have 2 k 's one after the other in a ROW.

Case 2)

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


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

Cindy
Sep 20 '07 #1
1 1228
Nepomuk
3,112 Expert 2GB
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 randomly filt 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 vacanies of each column must be filt with k 's (as many as nescesary).
Also it's not alloud to have 2 k 's one after the other in a ROW.

Case 2)

Every Collumn of the array must randomly filt with the letters a, b, c, d, e, f, g and h. Each colomn can only have each letter one time. If x is bigger than 8, then the vacancies of each column must be filt with k 's (as many as nescesary).
Also it's not alloud to have 2 k 's one after the other in a Row.
Hi Cindy!

I would first calculate, how many k's you need per column. Then find random positions for those k's in the first column (no two of them the same of course) and position them there. Remember the positions and do the same with the second column but check, if you saved one of the values for the previous column and if so, create a new position.

Continue doing this until you've positioned all k's. Then position the other letters in the columns at random positions (but of course no two letters in the same cell).

Hope that helps.

Greetings,
Nepomuk
Sep 21 '07 #2

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

Similar topics

7
by: seia0106 | last post by:
Hello, Writing a program in c++ that should use complex numbers I have two choices before me. 1- define a struct for complex data i.e struct {float real,imag; }ComplexNum; 2-use an array...
4
by: Mantorok Redgormor | last post by:
With what specifier do I use to print a variable of a complex type? The man page for printf doesn't even say. - nethlek
1
by: seia0106 | last post by:
Hello, I have an array X=, whose even and odd indices should represent real and imaginary parts of complex numbers. This I want to use in a routine that uses the typedef double Cx; for storing...
1
by: swayze | last post by:
Hi there, We're using php 4.1 and it doesn't seem to have built in support for this. Coming from a dotnet background this surprised me...Anyways, thats a different topic altogether... I'm...
2
by: jccorreu | last post by:
I'm taking in data from multiple files that represents complex numbers for charateristics of different elements. I begin with arrays of doubles and interpolate to get standard values in real and...
3
by: J.M. | last post by:
I have data in a double array of length 2N, which actually represents complex numbers with real and imaginary parts interlaced. In other words, elements in this array with even indices represents...
1
by: perroe | last post by:
Hi I have a array of complex numbers that are stored in a simple double array. This is done since the array is part of an wrapper for an external C library, and the imaginary part of the first...
1
cindy2
by: cindy2 | last post by:
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...
4
by: cleanrabbit | last post by:
Hello! I hate having to do this, because im almost certain there is someone in the world that has come across this problem and i just havent found their solution yet, so i do appologise if this...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.