Ejemplo n.º 1
0
        private static void Main(string[] args)
        {
            //File.Delete(@"C:\tmp\test.txt");
            //var k = new TextWriterTraceListener(@"C:\tmp\test.txt");
            //Trace.Listeners.Add(k);
            Trace.Listeners.Add(new ConsoleTraceListener());

            var table = new Table(5, 10);
            table.AddPlayer("Book Guy 1", new ByTheBookStrategy());
            table.AddPlayer("Ex-dealer", new DealerStrategy());
            //table.AddPlayer("Bad guy 1", new ImbicilePlayer());
            table.AddPlayer("Book Guy 2", new ByTheBookStrategy());
            table.AddPlayer("Bad guy 1", new ImbicileStrategy());
            table.AddPlayer("Mad man", new RandomStrategy());
            for (var i = 0; i < 10000; i++)
            {
                table.PlayHand();
            }
            table.ReportStats();
            Console.Read();
        }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            //File.Delete(@"C:\tmp\test.txt");
            //var k = new TextWriterTraceListener(@"C:\tmp\test.txt");
            //Trace.Listeners.Add(k);
            Trace.Listeners.Add(new ConsoleTraceListener());

            var table = new Table(5, 10);

            table.AddPlayer("Book Guy 1", new ByTheBookStrategy());
            table.AddPlayer("Ex-dealer", new DealerStrategy());
            //table.AddPlayer("Bad guy 1", new ImbicilePlayer());
            table.AddPlayer("Book Guy 2", new ByTheBookStrategy());
            table.AddPlayer("Bad guy 1", new ImbicileStrategy());
            table.AddPlayer("Mad man", new RandomStrategy());
            for (var i = 0; i < 10000; i++)
            {
                table.PlayHand();
            }
            table.ReportStats();
            Console.Read();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;

            var gameController = new GameController();
            var dealerAgency   = new DealerAgency();
            var gameRules      = new BlackJackRules();

            Logger.Write("Let\'s Play Blackjack!");
            Logger.Write("By: Eric Hasselbring");
            Logger.Linebreak();

            var firstTimePlayingMessage = "First Time Playing? (Yes/No)";
            // var isFirstTime = Input.GetInputYN(firstTimePlayingMessage);
            var isFirstTime = true;

            Logger.Write("Great! " + (isFirstTime ? "You are going to have so much fun!" : "Welcome back!"));

            var getNameMessage = "What is your name?";
            // var userInputName = Input.GetInputString(getNameMessage);
            var userInputName = "Eric";

            Logger.Write("Hi " + userInputName + "! Thanks for playing!");
            var user   = User.Create(userInputName);
            var player = new Player(user.Name);

            var table = new Table();

            table.AssignDeck(new Deck(gameRules.ReturnDeckCount()));
            table.AssignGameMode(gameRules);
            var dealer = dealerAgency.LoanDealer();

            table.AssignDealer(dealer);
            dealer.AssignTable(table);

            table.AddPlayer(player);
            Logger.Write(player.Name + " sat down at the table to play.");
            dealer.IntroduceSelf();

            gameController.AddTable(table);
            gameController.StartGame();

            Console.WriteLine("The End...");
            Console.ReadLine();
        }