using System.Collections.Generic;
public static void Main()
Card card1 = new Card("K", 'H');
Card card2 = new Card("A", 'S');
string[] deckValues = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"};
char[] deckSuits = {'S', 'H', 'D', 'C'};
List<Card> defaultDeck = new List<Card>();
foreach (string cardValue in deckValues)
foreach (char suit in deckSuits)
Card tempCard = new Card(cardValue, suit);
defaultDeck.Add(tempCard);
int deckSize = defaultDeck.Count;
Deck currentDeck = new Deck(deckSize);
currentDeck.shuffleDeck(defaultDeck);
List<Card> dealerHand = new List<Card>();
Card newCard = currentDeck.drawCard();
dealerTotal += (dealerHand[currentCard].getValue());
newCard = currentDeck.drawCard();
dealerTotal += (dealerHand[currentCard].getValue());
public static void displayHand(List<Card> hand)
string display = hand[currentCard].getDisplay();
int handSize = hand.Count;
Console.Write("The current hand contains: " + display);
cardValue = hand[currentCard].getValue();
while (currentCard < handSize)
display = hand[currentCard].getDisplay();
Console.Write(", " + display);
cardValue = hand[currentCard].getValue();
Console.WriteLine("Hand Total: " + handTotal);
public string value {get; set;}
public char suit {get; set;}
public Card(string newValue, char newSuit)
public string getDisplay()
suitDisplay = "Diamonds";
display = (value + " of " + suitDisplay);
string valueDisplay = "";
display = (valueDisplay + " of " + suitDisplay);
public List<Card> cards { get; set; }
public int size { get; set; }
cards = new List<Card>();
cards = new List<Card>();
public void shuffleDeck(List<Card> defaultDeck)
foreach (Card card in defaultDeck)
selector = rand.Next(size);
cards.RemoveAt(selector);
public int remainingCards()
foreach (Card card in cards)
if (card.getValue() != 0){