❔ Blackjack card randomizer
public static void Blackjack()
{
Console.Clear();
int card1 = 0;
int card2 = 0;
int card3 = 0;
while (true)
{
Random random1 = new Random();
card1 = random1.Next(1, 11);
Random random2 = new Random();
card2 = random2.Next(1, 11);
Console.WriteLine("your cards: {0} and {1}", card1, card2);
Console.WriteLine("do you want another card? y/n");
string hitstand = Convert.ToString(Console.ReadLine());
hitstand = hitstand.ToLower();
if (hitstand == "y")
{
Random random3 = new Random();
card3 = random3.Next(1, 11);
}
else if (hitstand == "n")
{
int cardtotal = card1 + card2 + card3;
bjMath(cardtotal);
}
}
i want to give the user 2 cards to begin with and they can keep picking cards that are random 1-10
ty
{
Console.Clear();
int card1 = 0;
int card2 = 0;
int card3 = 0;
while (true)
{
Random random1 = new Random();
card1 = random1.Next(1, 11);
Random random2 = new Random();
card2 = random2.Next(1, 11);
Console.WriteLine("your cards: {0} and {1}", card1, card2);
Console.WriteLine("do you want another card? y/n");
string hitstand = Convert.ToString(Console.ReadLine());
hitstand = hitstand.ToLower();
if (hitstand == "y")
{
Random random3 = new Random();
card3 = random3.Next(1, 11);
}
else if (hitstand == "n")
{
int cardtotal = card1 + card2 + card3;
bjMath(cardtotal);
}
}
i want to give the user 2 cards to begin with and they can keep picking cards that are random 1-10
ty
