static void Main(string[] args) { do { // Start game Console.WriteLine("Welcome to Blackjack!"); //shuffle deck var deck = new Deck(); deck.Shuffle(); //deal cards var dealer = new Dealer(); Hand playerHand = new Hand(); Hand compHand = new Hand(); //player gets cards dealer.Deal(deck, playerHand); int playerScore = playerHand.newHand[0].Value + playerHand.newHand[1].Value; Console.WriteLine($"Player hand: {playerHand.newHand[0].Suit} {playerHand.newHand[0].Face} {playerHand.newHand[1].Suit} {playerHand.newHand[1].Face}"); Console.WriteLine($"Player score: {playerScore}"); //dealer gets cards dealer.Deal(deck, compHand); int compScore = compHand.newHand[0].Value + compHand.newHand[1].Value; Console.WriteLine($"Dealer hand: {compHand.newHand[0].Suit} {compHand.newHand[0].Face} {compHand.newHand[1].Suit} {compHand.newHand[1].Face}"); Console.WriteLine($"Dealer score: {compScore}"); Console.WriteLine($"Number of cards left: {deck.cards.Count()}"); //does everyone have 21? tie game if (compScore == 21 && playerScore == 21) { Console.WriteLine("Both players have 21! Tie!"); } //does dealer have 21? dealer win else if (compScore == 21) { Console.WriteLine("Blackjack for the Dealer! 21!"); } //does player have 21? player win else if (playerScore == 21) { Console.WriteLine("Blackjack for you! 21! You win!"); } else { //class Player.Hit(), Stay() if 21 autostay, if score > 21 switch Ace to 1 var user = new Player(); Console.Write("(H)it or (S)tay: "); string input = Console.ReadLine(); var userPlay = user.CheckInput(input, deck, playerHand); if (userPlay == true) { Console.WriteLine("Computer turn!"); var dealerPlay = dealer.Play(deck, compHand); if (dealerPlay == true) { //resolve scores Console.WriteLine("scores are vs"); } else { Console.WriteLine("You win! Dealer busted."); } } else { Console.WriteLine("You busted! Over 21"); } Console.Write("Player hand: "); for (int i = 0; i < playerHand.newHand.Count(); i++) { Console.Write($"{playerHand.newHand[i].Suit} {playerHand.newHand[i].Face} "); } Console.WriteLine($"Player score: {playerScore}"); } Console.WriteLine("Play again? y/n"); restart = Convert.ToChar(Console.ReadLine()); } while (restart == 'y'); }