private void SimulateHand(IBlackjack game, int playerDraws) { for (int draws = 0; draws < playerDraws && !game.HandOver; draws++) { game.Hit(); } game.Stand(); }
public void Play(IBlackjack game) { if (game.ActiveHand.Value < hitBelow) { game.Hit(); } else { game.Stand(); } }
public void Play(IBlackjack game) { Console.WriteLine(game.ActiveHand); Console.WriteLine(game.Dealer); Deck deck = game.Deck; //Dictionary<int, int> count = ProbabilitiesDraw(deck); //foreach (int val in count.Keys) //{ // Console.Write("(" + val + "," + count[val] + "), "); //} //Console.WriteLine(); game.Hit(); }
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(); }