static void Main(string[] args) { List <Card> playdeck = new List <Card>(); List <Card> playerhand = new List <Card>(); List <Card> dealerhand = new List <Card>(); playdeck = Card.Shuffle(); string choice; int playercurrent, dealercurrent, count = 1, dealcount = 1; bool keepgoing = true; playerhand.Add(Card.Deal(playdeck)); dealerhand.Add(Card.Deal(playdeck)); playerhand.Add(Card.Deal(playdeck)); dealerhand.Add(Card.Deal(playdeck)); Console.WriteLine($"Dealer shows {dealerhand[0]}"); Console.Write($"Player shows {playerhand[0]} & {playerhand[1]}\n"); do { playercurrent = playerhand.Sum(card => card.GetCardValue()); if (playercurrent > 21) { Console.WriteLine($"Your cards total to {playercurrent} which means you lose the game."); Environment.Exit(0); } else if (playercurrent == 21) { Console.WriteLine($"Your cards total to {playercurrent} which means you win the game!"); Environment.Exit(0); } Console.Write("Would you like to Hit or Stay?"); choice = Console.ReadLine(); if (choice == "Hit") { playerhand.Add(Card.Deal(playdeck)); count++; Console.WriteLine($"You were dealt {playerhand[count]}"); } } while (choice != "Stay"); Console.WriteLine($"Dealer reveals their second card to be {dealerhand[1]}. Dealer total is {dealerhand.Sum(card => card.GetCardValue())}"); do { dealercurrent = dealerhand.Sum(card => card.GetCardValue()); if (dealercurrent > 21) { Console.WriteLine($"Dealer has busted {dealercurrent} which means you win."); keepgoing = false; } else if (dealercurrent > playercurrent) { Console.WriteLine("You lose because the value of the Dealer's hand is higher than yours."); keepgoing = false; } else if (dealercurrent < 16) { dealerhand.Add(Card.Deal(playdeck)); Console.WriteLine($"Dealer was dealt {dealerhand[dealcount]}"); dealcount++; } else if (dealercurrent == 21) { Console.WriteLine("You lose because the Dealer's hand is 21."); keepgoing = false; } else if (dealercurrent >= 16 && dealercurrent < 21 && dealercurrent >= playercurrent) { Console.WriteLine($"Dealer has {dealercurrent} and you have {playercurrent} Dealer wins."); keepgoing = false; } else if (dealercurrent >= 16 && dealercurrent < 21 && dealercurrent < playercurrent) { Console.WriteLine($"Dealer has {dealercurrent} and you have {playercurrent} You win."); keepgoing = false; } } while (keepgoing); }