using static System.Console;
using System.Collections.Generic;
var myCardDeck = new List<CardDeck>()
new CardDeck {CardSuit = "Hearts", CardPips = "Ace", CardValue = 14},
new CardDeck {CardSuit = "Spades", CardPips = "4", CardValue = 4},
new CardDeck {CardSuit = "Spades", CardPips = "Jack", CardValue = 11},
new CardDeck {CardSuit = "Diamonds", CardPips = "2", CardValue = 2},
new CardDeck {CardSuit = "Hearts", CardPips = "King", CardValue = 13},
new CardDeck {CardSuit = "Spades", CardPips = "Queen", CardValue = 12},
new CardDeck {CardSuit = "Clubs", CardPips = "King", CardValue = 13},
new CardDeck {CardSuit = "Diamonds", CardPips = "5", CardValue = 5},
new CardDeck {CardSuit = "Diamonds", CardPips = "9", CardValue = 9},
new CardDeck {CardSuit = "Spades", CardPips = "7", CardValue = 7},
new CardDeck {CardSuit = "Hearts", CardPips = "8", CardValue = 8},
new CardDeck {CardSuit = "Spades", CardPips = "2", CardValue = 2},
new CardDeck {CardSuit = "Diamonds", CardPips = "7", CardValue = 7},
new CardDeck {CardSuit = "Hearts", CardPips = "4", CardValue = 4},
new CardDeck {CardSuit = "Clubs", CardPips = "Queen", CardValue = 12},
new CardDeck {CardSuit = "Spades", CardPips = "9", CardValue = 9},
new CardDeck {CardSuit = "Clubs", CardPips = "Ace", CardValue = 14}
bool isValidResponse = false;
int playerFinalScore = 0;
myDeckSize = myCardDeck.Count;
WriteLine("We're going to play a little game of Hi/Low. Aces are high!");
WriteLine($"The first card is the {myCardDeck[0].CardPips} of {myCardDeck[0].CardSuit}. Will the next card be higher or lower?");
lastCardValue = myCardDeck[0].CardValue;
for (int counter = 1;counter <= myDeckSize - 1; counter++)
playerResponse = ReadLine();
if((lastCardValue < myCardDeck[counter].CardValue && (playerResponse.ToLower() == "higher" || playerResponse.ToLower() == "h")) ||(lastCardValue > myCardDeck[counter].CardValue && (playerResponse.ToLower() == "lower" || playerResponse.ToLower() == "l")))
WriteLine($"The {myCardDeck[counter].CardPips} of {myCardDeck[counter].CardSuit}. You win!");
lastCardValue = myCardDeck[counter].CardValue;
if (counter >= myDeckSize-1)
WriteLine("We're all out of cards! You've gotten the highest score possible, well done! \n \n Unless, of course, you cheated... you would be a cheater though, would you?");
WriteLine("Will the next card be higher or lower?");
else if (lastCardValue == myCardDeck[counter].CardValue)
WriteLine($"The {myCardDeck[counter].CardPips} of {myCardDeck[counter].CardSuit}. That's a tie, no one wins.");
lastCardValue = myCardDeck[counter].CardValue;
WriteLine("Will the next card be higher or lower?");
WriteLine($"The {myCardDeck[counter].CardPips} of {myCardDeck[counter].CardSuit}. Sorry, you lose!");
for (int counter = 2; counter <= playerWinCount; counter++)
playerFinalScore = playerFinalScore * 2;
WriteLine($"You guessed correctly {playerWinCount} times for a final score of {playerFinalScore}.");
public string CardSuit {get;set;}
public string CardPips {get;set;}
public int CardValue {get;set;}