コード例 #1
0
        public override bool TakeInsurance(Game game)
        {
            int[] shoe = game.Shoe.Counts;
            shoe[game.DealerHand[1].PointValue - 1]++;

            double insurance_ev = Eval.InsuranceEv(max_bet, shoe);

            if (insurance_ev >= 0.0)
            {
                return(true);
            }
            else
            {
                return(false);
            }

            /*
             * // remember the unseen dealt second dealer card, which is still reduced from shoe!
             * // take into account
             * int seen_tens = card_counts[9];
             * if (game.PlayerHandSet.ActiveHand[0].IsTenValue())
             *      seen_tens++;
             * if (game.PlayerHandSet.ActiveHand[1].IsTenValue())
             *      seen_tens++;
             *
             * // add the dealer's second dealt card to unknown count (+1)
             * double bj_prob = (double)(8*4*4-seen_tens) / (double)(game.Shoe.Count + 1);
             * double insurance_ev = 1.0*bj_prob-0.5*(1.0-bj_prob);
             *
             * // we take insurance
             * if (insurance_ev >= 0.0)
             *      return true;
             * else
             *      return false;*/
        }
コード例 #2
0
        public override bool TakeInsurance(CardSet seen_cards)
        {
            Shoe tmp_shoe = shoe.Copy();

            tmp_shoe.Remove(seen_cards);

            double insurance_ev = Eval.InsuranceEv(current_bet, tmp_shoe.ToArray());

            if (insurance_ev >= 0.0)
            {
                game_logger.Insurance(true);
                insurance_taken = true;
                return(true);
            }

            return(false);
        }