Esempio n. 1
0
 private void SimulateHand(IBlackjack game, int playerDraws)
 {
     for (int draws = 0; draws < playerDraws && !game.HandOver; draws++)
     {
         game.Hit();
     }
     game.Stand();
 }
Esempio n. 2
0
 public void Play(IBlackjack game)
 {
     if (game.ActiveHand.Value < hitBelow)
     {
         game.Hit();
     }
     else
     {
         game.Stand();
     }
 }
Esempio n. 3
0
        public void Play(IBlackjack game)
        {
            double winZero = Simulate(game, 0);
            double winDraw = 0;

            for (int currentDraw = 1; currentDraw <= maxDraw; currentDraw++)
            {
                winDraw += Simulate(game, currentDraw);
                if (currentDraw == 1 && winDraw > doubleDown)
                {
                    game.DoubleDown();
                    return;
                }
                if (winDraw > winZero)
                {
                    game.Hit();
                    return;
                }
            }
            game.Stand();
        }