2
Answers

C# Enumerations in random

Jonathan Crispe

Jonathan Crispe

12y
1.5k
1
I have enum: "Ten, Jack, Queen, King, Ace"

how can i make it a random,

i mean, if a press a button
it will display 5 cards randomly...

like in the picture below


my code:
  public enum m_Cards { Ten, Jack, Queen, King, Ace };
  private void button1_Click(object sender, EventArgs e)
  {
  m_Cards[] cHand = new m_Cards[5];
  Random random = new Random();
  }

i tried adding for loop but says its missing a cast, so i delete it...
thank you for the help...


Answers (2)