473,399 Members | 2,858 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,399 software developers and data experts.

enum: min, max, count, random?

How can I get the minimum value, maximum value, the number of items in an
enum and a random value from an enum?
I intend to use an enum as a lookup table for randomly selected colours.
Or is enum the wrong choice? better use an array?

thanks herbert
Nov 22 '05 #1
1 4076
Hi,

A good start point to take a look to "Enum" class. Enum class offers
methods to acess enum values and elements.

I think that the use of enum for a lookup table is a good choice, but I have
hundreads of elements conseider using an Array :)

--
[]''s
Guilherme Labigalini
"herbert" wrote:
How can I get the minimum value, maximum value, the number of items in an
enum and a random value from an enum?
I intend to use an enum as a lookup table for randomly selected colours.
Or is enum the wrong choice? better use an array?

thanks herbert

Nov 22 '05 #2

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

Similar topics

1
by: herbert | last post by:
How can I get the minimum value, maximum value, the number of items in an enum and a random value from an enum? I intend to use an enum as a lookup table for randomly selected colours. Or is enum...
3
by: BlueOysterCult | last post by:
Hello I am having dificulty with this homework question ( I know its homework but I have been trying for a while with this) "generate 50 random numbers between 0 and 6 and count the number of...
3
by: Richard | last post by:
Okay gang, This should be simple but apparently it's not... I want to use the System.DayOfWeek enum to create and access an array of objects with one object for each day of the week. I'd like...
6
by: Marc Scheuner [MVP ADSI] | last post by:
Folks, I was trying to achieve the following thing: I have a "structure" that basically is a two-dimensional array of numeric values. Both dimensions are handled by enumeration types in C#: ...
9
by: gl | last post by:
How do I take an array or arraylist, and sort it randomly? Like suppose the items in it are (1,2,3,4,5) and I want to get it to be in a random order (2,3,1,4,5). How do you do that? I think it's a...
3
by: Darren Clark | last post by:
I do the following in code int count = randata.ProductTable.Rows.Count; Random r = new Random(); Random r2 = new Random(); int i = r.Next(1,count);
38
by: One Handed Man \( OHM - Terry Burns \) | last post by:
I have a basic question thats been niggling me, but I never found time to look at it before. If I have an enumeration such as this Fiend Enum TravelDirection North South East
8
by: Kari Lavikka | last post by:
Hi! I have to select a random row from a table where primary key isn't continuous (some rows have been deleted). Postgres just seems to do something strange with my method. -- -- Use the...
8
by: Mark P | last post by:
I'm working on a project where I have something like enum Modes {mode_a, mode_b, ...}; Due to project spec changes, the number of Modes has increased several times. There are a few places...
8
by: Anil Gupte | last post by:
I had someone write a random number generator in C# (I am more of a VB programmer) and they came up with the following: public string GetRand(int count) { string number = ""; for (int i=0;...
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
Oralloy
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,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
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...

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.