Hi there
I need help with a tricky problem.
I have a 2 dimensional array with qualities such as
ball size, ball color, ball weight.
Now I have to print out all the possible combinations of this.
assume I have it stored as such
i have two dimensional array ball:
ball (x,y)
x = the number of possible things a ball can be, like color, size ,weight,
bounce height, smootheness for example.
y = is that feature like red,green, blue - 3 inches, 2 inches - 3 lbs, 1
lbs - 3 feet hi, 1 foot hi, 5 ft hi - smooth, rough, bumpy
now, how can I loop thru this array and pring all the combinations:
like bal(0,0) + bal(1,0) + ball(2,0) + ball(3,0)+ball( 4,0)= red+2inches+3
lbs+3 feet hi+smooth
ball(0,0)+ball( 1,0)+ball(2,0)+ ball(3,0)+ball( 4,1) = red+2inches+3lb s+3feet
hig+rough
etc
thanks in advance 5 1623
Do you want to do a numeric or a text field addition?? Your question is
unclear to me but I think I can give the answer if you spell out what you
want to achieve a bit more.
Do you want a string or a code or a number or what?
---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system ( http://www.grisoft.com).
Version: 6.0.688 / Virus Database: 449 - Release Date: 18/05/2004
Thanks for your response.
I would like the actual strings to show what the combinations are.
Assume the actual strings are already in the multidimensiona l array as show
in my post.
I just dont know how to loop through the array to build this string.
since you can really only access one element of the array at a time with the
loop
Would be great if you could help
Thanks
"WindAndWav es" <ac****@ngaru.c om> wrote in message
news:ZS******** ***********@new s.xtra.co.nz... Do you want to do a numeric or a text field addition?? Your question is unclear to me but I think I can give the answer if you spell out what you want to achieve a bit more.
Do you want a string or a code or a number or what?
--- Please immediately let us know (by phone or return email) if (a) this
email contains a virus (b) you are not the intended recipient (c) you consider this email to be spam. We have done our utmost to make sure that none of the above are applicable. THANK YOU Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.688 / Virus Database: 449 - Release Date: 18/05/2004
On Thu, 20 May 2004 11:01:06 GMT, "Danny" <da********@hot mail.com>
wrote:
Try something like:
dim x as integer
dim y as integer
for x=0 to ubound(ball(1))
for y = 0 to ubound(ball(2))
debug.print "ball(" & x & "," & y & ")=" & ball(x,y)
next y
next x
-Tom. Hi there
I need help with a tricky problem. I have a 2 dimensional array with qualities such as ball size, ball color, ball weight.
Now I have to print out all the possible combinations of this.
assume I have it stored as such i have two dimensional array ball: ball (x,y) x = the number of possible things a ball can be, like color, size ,weight, bounce height, smootheness for example. y = is that feature like red,green, blue - 3 inches, 2 inches - 3 lbs, 1 lbs - 3 feet hi, 1 foot hi, 5 ft hi - smooth, rough, bumpy
now, how can I loop thru this array and pring all the combinations: like bal(0,0) + bal(1,0) + ball(2,0) + ball(3,0)+ball( 4,0)= red+2inches+3 lbs+3 feet hi+smooth ball(0,0)+ball (1,0)+ball(2,0) +ball(3,0)+ball (4,1) = red+2inches+3lb s+3feet hig+rough
etc
thanks in advance
This just prints each feature out, I need to print out all possbile
combinations.
like:
red+2inches+3lb s+3 feet hi+smooth
not just
red
2inches
3 lbs
3 feet hi
smooth
This is tricky
"Tom van Stiphout" <to*****@no.spa m.cox.net> wrote in message
news:ks******** *************** *********@4ax.c om... On Thu, 20 May 2004 11:01:06 GMT, "Danny" <da********@hot mail.com> wrote: Try something like: dim x as integer dim y as integer for x=0 to ubound(ball(1)) for y = 0 to ubound(ball(2)) debug.print "ball(" & x & "," & y & ")=" & ball(x,y) next y next x
-Tom.
Hi there
I need help with a tricky problem. I have a 2 dimensional array with qualities such as ball size, ball color, ball weight.
Now I have to print out all the possible combinations of this.
assume I have it stored as such i have two dimensional array ball: ball (x,y) x = the number of possible things a ball can be, like color, size
,weight,bounce height, smootheness for example. y = is that feature like red,green, blue - 3 inches, 2 inches - 3 lbs, 1 lbs - 3 feet hi, 1 foot hi, 5 ft hi - smooth, rough, bumpy
now, how can I loop thru this array and pring all the combinations: like bal(0,0) + bal(1,0) + ball(2,0) + ball(3,0)+ball( 4,0)= red+2inches+3 lbs+3 feet hi+smooth ball(0,0)+ball (1,0)+ball(2,0) +ball(3,0)+ball (4,1) =
red+2inches+3lb s+3feethig+rough
etc
thanks in advance
On Thu, 20 May 2004 15:11:46 GMT, "Danny" <da********@hot mail.com>
wrote:
Now I'm confused. It appears you want all permutations, but that
wouldn't make sense if the data is stored in a 2-dimensional array.
-Tom. This just prints each feature out, I need to print out all possbile combinations . like: red+2inches+3l bs+3 feet hi+smooth not just red 2inches 3 lbs 3 feet hi smooth
This is tricky
"Tom van Stiphout" <to*****@no.spa m.cox.net> wrote in message news:ks******* *************** **********@4ax. com... On Thu, 20 May 2004 11:01:06 GMT, "Danny" <da********@hot mail.com> wrote: Try something like: dim x as integer dim y as integer for x=0 to ubound(ball(1)) for y = 0 to ubound(ball(2)) debug.print "ball(" & x & "," & y & ")=" & ball(x,y) next y next x
-Tom.
>Hi there > >I need help with a tricky problem. >I have a 2 dimensional array with qualities such as >ball size, ball color, ball weight. > >Now I have to print out all the possible combinations of this. > >assume I have it stored as such >i have two dimensional array ball: >ball (x,y) >x = the number of possible things a ball can be, like color, size,weight, >bounce height, smootheness for example. >y = is that feature like red,green, blue - 3 inches, 2 inches - 3 lbs, 1 >lbs - 3 feet hi, 1 foot hi, 5 ft hi - smooth, rough, bumpy > >now, how can I loop thru this array and pring all the combinations: >like bal(0,0) + bal(1,0) + ball(2,0) + ball(3,0)+ball( 4,0)= red+2inches+3 >lbs+3 feet hi+smooth >ball(0,0)+ball (1,0)+ball(2,0) +ball(3,0)+ball (4,1) =red+2inches+3l bs+3feet >hig+rough > >etc > >thanks in advance > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Felix |
last post by:
Dear Sql Server experts:
First off, I am no sql server expert :)
A few months ago I put a database into a production environment.
Recently, It was brought to my attention that a particular query that
executed quite quickly in our dev environment was painfully slow in
production. I analyzed the the plan on the production server (it
looked...
|
by: Jerry Brenner |
last post by:
Our users have potentially dirty legacy data that they need to get
into our application. We provide a set of staging tables, which map
to our source tables, that the users do their ETL into. Every row in
the source tables has a generated integer id. Every row in both the
source and staging tables has a unique publicid (varchar(22)). All...
|
by: Sky Fly |
last post by:
Hello all,
I've written a stored procedure which runs OK for the
first few thousand records it processes, then around
about the 10,000th record it suffers a sudden and dramatic
drop in performance (from about 40 records per second to
about 1 per second).
I've found that when this happens, if I run an UPDATE STATISTICS
query on the...
|
by: Metal Dave |
last post by:
Hello,
A script we run against the database as part of the upgrade of our product
is failing with the following message:
ALTER TABLE ALTER COLUMN EncodedID failed because STATISTICS hind_61_3
accesses this column
The line that fails is:
|
by: Ross A. Finlayson |
last post by:
Hi,
I wonder if there is a simple library or set of functions for basic
statistical functions, like what may be on a pocket calculator, without
getting into linking into the language runtimes of the S or R
languages.
For example I just want mean, median, mode, variance, and stuff, and
then the stuff that follows from that. Maybe,...
| |
by: romixnews |
last post by:
Hi,
I'm facing the problem of analyzing a memory allocation dynamic and
object creation dynamics of a very big C++ application with a goal of
optimizing its performance and eventually also identifying memory
leaks. The application in question is the Mozilla Web Browser. I also
have had similar tasks before in the compiler construction area....
|
by: Allan Ebdrup |
last post by:
Hi
We have a large class library of different classes, now we are going to
implement a lot of usage statistics that we need, stuff like how many times
a user has logged in, how many times a message has been read, how many times
a ad has been shown and so on.
Now I'm wondering what would be a good OO organization of this data, should
the...
|
by: Quasar |
last post by:
Hi everybody!
I''ve created a script that enable the statistics for a specific DB:
#!/bin/sh
if ; then
echo Enabling monitoring switches for ${1}
db2 connect to ${1}
db2 update monitor switches using TABLE on UOW on TIMESTAMP on
STATEMENT on BUFFERPOOL on LOCK on SORT on
|
by: w.l.fischer |
last post by:
Is it possible to have statistics on temporary tables? I frequently
put 10000 or more rows in a temporary table and would like to know it
the queries become faster with statistics on those tables.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |