473,383 Members | 1,980 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,383 software developers and data experts.

MultiColor Calculations

I need to make a program that uses ten basic colors (eg. red,green,blue) in combinations. I need each color to make a combination as a pair and triple with other colors. For example: red|green, red|blue, red|yellow, green|blue, and so on, but you can't use green|red because we already use red|green. Get it?, then i have to make multiples of threes as well red|green|blue etc..
I have no idea where to begin or how I should set this up, I sure in an array of some sort or recursive callbacks, any suggestions would be appreciated
Thanks.
Nov 20 '05 #1
5 1031
something like

dim colors() as String
dim duoColorCollection as Collection

dim i as integer
dim j as integer

for i = 0 to colors.lenght - 2
for j=i +1 to colors.lenght - 1
duoColorCollection.add(colors(i) + "-" + colors(j))
next j
next i

duocollorscollection will contain all "mixed" colors but no "inverse equals"

i hope what i wrote is right, did it without testing ;-)
but the system can be something like this
hope this helps

dominique
"OptikConnex" <an*******@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
I need to make a program that uses ten basic colors (eg. red,green,blue) in combinations. I need each color to make a combination as a pair and
triple with other colors. For example: red|green, red|blue, red|yellow,
green|blue, and so on, but you can't use green|red because we already use
red|green. Get it?, then i have to make multiples of threes as well
red|green|blue etc... I have no idea where to begin or how I should set this up, I sure in an array of some sort or recursive callbacks, any suggestions would be
appreciated. Thanks.

Nov 20 '05 #2
I don't quite see what you are doing in your posted code. How would I display the colors side by side then. And what are you assigning colors to
dim colors() as Strin
dim duoColorCollection as Collectio

dim i as intege
dim j as intege

for i = 0 to colors.lenght -
for j=i +1 to colors.lenght -
duoColorCollection.add(colors(i) + "-" + colors(j)
next
next

Nov 20 '05 #3
Scratch that last comment i see what you are doing. Just needed the caffeine to get me going. But now I get an erro
at this line of code: duoColorCollection.Add(colors(i) + "-" + colors(j)) what do i need to do next

Dim colors(4) As Strin
Dim duoColorCollection As Collectio

Dim i As Intege
Dim j As Intege
colors(1) = "Red
colors(2) = "Green
colors(3) = "Blue
colors(4) = "Purple

For i = 0 To colors.Length -
For j = i + 1 To colors.Length -
duoColorCollection.Add(colors(i) + "-" + colors(j)
Next
Next

Nov 20 '05 #4
OK I figured most of it out now, but how do I display the results. Here is the code

Dim colors(4) As Strin
Dim duoColorCollection As New Collectio

Dim i As Intege
Dim j As Intege
colors(1) = "Red
colors(2) = "Green
colors(3) = "Blue
colors(4) = "Purple

For i = 0 To colors.Length -
For j = i + 1 To colors.Length -
duoColorCollection.Add(colors(i) + "-" + colors(j)
Next
Next
Where do I display my results eg red-gree
Im an idiot, I know but things aren't clicking today.
Nov 20 '05 #5
your duocolorcollection is a collection containing strings ("Red-Green",
"Red-Blue", ...)

so just do something like

dim oneColor as string
for each oneColor in duoColorCollection
debug.writeline(oneColor)
next
PS:
I even didn't know the collection object realy exists, i was pointing to
some kind of collection object (arraylist,...)
java background you know ;-)
"OptikConnex" <an*******@discussions.microsoft.com> wrote in message
news:27**********************************@microsof t.com...
OK I figured most of it out now, but how do I display the results. Here is the code.
Dim colors(4) As String
Dim duoColorCollection As New Collection

Dim i As Integer
Dim j As Integer
colors(1) = "Red"
colors(2) = "Green"
colors(3) = "Blue"
colors(4) = "Purple"

For i = 0 To colors.Length - 2
For j = i + 1 To colors.Length - 1
duoColorCollection.Add(colors(i) + "-" + colors(j))
Next j
Next i
Where do I display my results eg red-green
Im an idiot, I know but things aren't clicking today.

Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
4
by: Targa | last post by:
Trying to total some price fields in a form but doesnt work when all the referenced form fields dont exisit. This is for an invoice - pulled prom a database and the form doesnt always contain the...
11
by: lduperval | last post by:
Hi, I`m trying to do date calculations in three types of time zones: local, GMT and specified. The issue I am facing is that I need to be able to specify a date in the proper time zone, and I`m...
3
by: brian kaufmann | last post by:
Hi, I had sent this earlier, and would appreciate any suggestions on this. I need to make calculations for unemployment rate for three different data sources (A,B,C) for many countries and age...
3
by: John M | last post by:
Hi, I've been coming up against a failure of a report to display the result of a simple calculation. I have realised that this calculation cannot take place unless the field I am working on is...
0
by: SJM | last post by:
There is a database which has combo boxes to allow users to select values from pre-set lists of common specifications. The form allows users to enter values that are not in the dropdown lists....
13
by: fredrik.ryde | last post by:
Hi, I have a database which contains alot of finacial data. I want to retreive some data, run som calculations with it, nothing complex just simple arithmetic. I wonder if it's faster to let...
4
by: Iacopo.Marmo | last post by:
Hi! I need to manipulate multicolor strings, i.e. strings with a color associated with each letter. Any suggestions?
1
by: Grubsy4u | last post by:
Grubsy4u Newbie 7 Posts October 5th, 2007 11:31 AM #1 Report calculations --------------------------------------------------------------------------------
9
Catalyst159
by: Catalyst159 | last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows: Part A: Maximum FAR and Floor Area: Part B: Gross Floor Area of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.