Ive got a simple script of which I want to randomize the order of the notation.
My enumeration:
enum Weather { cold, sunny, rainy }
Program:
static void Main(string[] args)
{
Weather weather = Weather.cold;
Random r = new Random();
string[] goh = new string[3];
for (int i = 0; i <= 2; i++)
{
goh[i] = (weather.ToString());
Console.WriteLine(goh[i]);
weather++;
}
Now, I DO know how I could generally randomize the process of the array elements assignments. But that is not exactly what I want. I'd like each weather, to be picked ONCE in a random order. So for example, sunny, rainy, cold. But how exactly do you let the system know that a particular weather type is already picked and should not be picked again, so you dont get something like sunny sunny, rainy.
Thanks in advance.


Sign In
Create Account


Back to top









