using System; using System.Collections.Generic; using System.Linq; using System.Text; using BlackjackClasses; namespace ConsoleBlackJack { class Program { static void Main(string[] args) { Console.WriteLine("Welcome to Blackjack"); Player house = new Player(); Player player = new Player(); Round r = new Round(house, player); List houseHand = new List(); houseHand.Add(new Card(Card.CardSuits.Clubs, Card.CardValues.Jack)); houseHand.Add(new Card(Card.CardSuits.Spades, Card.CardValues.Seven)); List playerHand = new List(); playerHand.Add(new Card(Card.CardSuits.Hearts, Card.CardValues.Jack)); playerHand.Add(new Card(Card.CardSuits.Hearts, Card.CardValues.King)); r.CheatRound(houseHand, playerHand ); Console.WriteLine(r.ToString()); string strChoice = ""; while (r.status.Equals(Round.GameStatus.UnfinishedGame)) { Console.WriteLine("Press H to hit, press S key to stay"); strChoice = Console.ReadKey().Key.ToString().ToUpper(); if (strChoice == "H") r.cheatHitPlayer(new Card(Card.CardSuits.Diamonds, Card.CardValues.Six)); else if (strChoice == "S") r.stay(); Console.WriteLine(r.ToString()); } //Console.WriteLine(r.ToString()); Console.WriteLine("Game status: " + r.status); //string strChoice = ""; while (strChoice =="Y") { NewGame(); Console.WriteLine("Press Y key to play again, any other key to quit"); strChoice = Console.ReadKey().Key.ToString().ToUpper(); } Console.ReadKey(); } private static void NewGame() { Console.WriteLine("New Game"); Player house = new Player(); Player player = new Player(); Round g = new Round(house, player); Console.WriteLine(g.ToString()); while (g.status.Equals(Round.GameStatus.UnfinishedGame)) { Console.WriteLine("Press H to hit, press S key to stay"); string strChoice = Console.ReadKey().Key.ToString().ToUpper(); if (strChoice == "H") g.hit(); else if (strChoice == "S") g.stay(); Console.WriteLine(g.ToString()); } Console.WriteLine(g.status.ToString()); } } }