Jonathan Crispe

Jonathan Crispe

  • NA
  • 46
  • 48.4k

C# Enumerations in random

Nov 27 2011 2:38 AM
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)