private static void GamesLaunch(string strategy) { int min = int.MaxValue; int avg = 0; int max = 0; for (int i = 0; i < 1000; i++) { IBot bot; if (strategy == "base") bot = new BaseStrategyBot(1000); else if (strategy == "thorp") bot = new ThorpSystemBot(1000); else if (strategy == "kelly") bot = new KellyCriterionBot(1000); else return; Casino.Game(bot, 40, new Shoes()); max = max > bot.Balance ? max : bot.Balance; min = min < bot.Balance ? min : bot.Balance; avg += bot.Balance; } Console.WriteLine("Minimum balance = " + min); Console.WriteLine("Average balance = " + avg / 1000); Console.WriteLine("Maximum balance = " + max + "\n"); }
public void BotPlayTest() { Bot bot = new ThorpSystemBot(1000); bot.Hands[0].Cards.Add(new Card(CardRank.Nine)); bot.Hands[0].Cards.Add(new Card(CardRank.Ten)); var shoes = new Shoes(); shoes.Decks[CardRank.Two] = 22; bot.Play(new Card(CardRank.Seven), shoes); Assert.AreEqual(26, bot.CurrentBet); }