Esempio n. 1
0
        public void OneThreeTwoSixBotActionAfterBlackjackTest()
        {
            var bot = new OneThreeTwoSixBot(exampleStartMoney, exampleStartRate);

            bot.TakeCard(new UsualCard(CardNames.Ten, CardSuits.Diamond));
            bot.TakeCard(new AceCard(CardSuits.Diamond));
            bot.MakeNextPlayerTurn(new AceCard(CardSuits.Diamond));

            Assert.IsTrue(bot.PlayerTurnNow == PlayerTurn.Take);
        }
Esempio n. 2
0
        public void GameWithOneThreeTwoSixBotConstructorTest()
        {
            var secondBot  = new OneThreeTwoSixBot(1000, minimumRate);
            var secondGame = new Game(secondBot);

            secondGame.CreateGame(countDecksInOne);

            Assert.IsNotNull(secondBot);
            Assert.IsNotNull(secondGame.Deck);
            Assert.IsNotNull(secondGame.Dealer);
            Assert.IsNotNull(secondGame.Bot);
            Assert.AreEqual(secondBot, secondGame.Bot);
        }
Esempio n. 3
0
        public void OneThreeTwoSixBotNextGamePreparationTest()
        {
            var bot = new OneThreeTwoSixBot(exampleStartMoney, exampleStartRate);

            bot.Win();
            Assert.IsTrue(bot.Rate == exampleStartRate * 3);

            bot.Win();
            Assert.IsTrue(bot.Rate == exampleStartRate * 2);

            bot.Lose();
            Assert.IsTrue(bot.Rate == exampleStartRate);
        }
Esempio n. 4
0
        public void OneThreeTwoSixBotPlayTest()
        {
            var secondBot  = new OneThreeTwoSixBot(1000, minimumRate);
            var secondGame = new Game(secondBot);

            secondGame.CreateGame(countDecksInOne);

            int startCountOfCards = secondGame.Deck.Deck.Count();

            secondGame.CreateGame(countDecksInOne);

            Assert.DoesNotThrow(() => secondGame.StartGame());
            Assert.IsTrue(secondGame.Deck.Deck.Count() < startCountOfCards);
        }
Esempio n. 5
0
        static void Main(string[] agrs)
        {
            Console.WriteLine("This program show what balance you'll have after play Blackjack" +
                              "with one of the strategies: \n");

            int countGames               = 50000;
            int startMoney               = 10000;
            int startRate                = 500;
            int sumAfterGame             = 0;
            int countLoseAllBalanceGames = 0;

            // PrimitiveManchetanStrategyBot statistic

            for (int i = 0; i < countGames; i++)
            {
                PrimitiveManchetanStrategyBot bot = new PrimitiveManchetanStrategyBot(startMoney, startRate);
                Game game = new Game(bot);
                game.CreateGame(8);
                game.StartGame();
                sumAfterGame += (int)bot.Money;
                if (bot.Money <= 0)
                {
                    countLoseAllBalanceGames++;
                }
            }
            Console.WriteLine("1) PrimitiveManchetanStrategyBot statistic: ");
            Console.WriteLine($"Average winnings over 40 games ---> {sumAfterGame / 50000}/{startMoney} <--- Your start balance");
            Console.WriteLine("The number of games when a player loses his entire balance ---> " + countLoseAllBalanceGames);

            // MartingaleBot statistic
            sumAfterGame             = 0;
            countLoseAllBalanceGames = 0;

            for (int i = 0; i < countGames; i++)
            {
                MartingaleBot bot  = new MartingaleBot(startMoney, startRate);
                Game          game = new Game(bot);
                game.CreateGame(8);
                game.StartGame();
                sumAfterGame += (int)bot.Money;
                if (bot.Money <= 0)
                {
                    countLoseAllBalanceGames++;
                }
            }
            Console.WriteLine("2) MartingaleBot statistic: ");
            Console.WriteLine($"Average winnings over 40 games ---> {sumAfterGame / 50000}/{startMoney} <--- Your start balance");
            Console.WriteLine("The number of games when a player loses his entire balance ---> " + countLoseAllBalanceGames);

            // OneThreeTwoSixBot statistic
            sumAfterGame             = 0;
            countLoseAllBalanceGames = 0;

            for (int i = 0; i < countGames; i++)
            {
                OneThreeTwoSixBot bot = new OneThreeTwoSixBot(startMoney, startRate);
                Game game             = new Game(bot);
                game.CreateGame(8);
                game.StartGame();
                sumAfterGame += (int)bot.Money;
                if (bot.Money <= 0)
                {
                    countLoseAllBalanceGames++;
                }
            }
            Console.WriteLine("3) OneThreeTwoSixBot statistic: ");
            Console.WriteLine($"Average winnings over 40 games ---> {sumAfterGame / 50000}/{startMoney} <--- Your start balance");
            Console.WriteLine("The number of games when a player loses his entire balance ---> " + countLoseAllBalanceGames);

            Console.WriteLine("<----------------------------------------------->");
            return;
        }
Esempio n. 6
0
        public void OneThreeTwoSixBotConstructorTest()
        {
            var bot = new OneThreeTwoSixBot(exampleStartMoney, exampleStartRate);

            ConstructorTest(bot);
        }