vendredi 28 août 2015

Randomize 4 Colors and save C#

I'm creating a Mastermind game where the user choses 4 out of 5 colors and see if it's a match. It would then send the given color combination to the CheckClass to see if the combination is right.

My question is, how could i randomize 4 between Red, Blue, Yellow, Lime and Purple?

Would I have to randomize with the different color codes? This is what i've found so far:

private Color GetRandomColor()
{
return Color.FromArgb(random.Next(0, 255), random.Next(0, 255), random.Next(0, 255));
}

Which color codes should i use?

Thanks!




Aucun commentaire:

Enregistrer un commentaire