This question already has an answer here:
static Cards Dealer(List<Cards> cards)
{
var dealer = new Random();
return cards[dealer.Next(cards.Count)];
}
static void GameStart(double cash, List<Cards> cards, double wager)
Console.WriteLine("dealer has" + Dealer(cards).Name + " " + Dealer(cards).Suit);
Console.WriteLine("dealer has" + Dealer(cards).Name + " " + Dealer(cards).Suit);
I want to get a random card from my list but so far it returns the same card each time. Is there something I need to do to renew the random gen each time I call the method? much appreciated.
Aucun commentaire:
Enregistrer un commentaire