Exemple #1
0
        public string Stand()
        {
            int userTotal   = UserHand.HandTotal();
            int dealerTotal = DealerHand.HandTotal();

            if (userTotal <= 21)
            {
                if (Math.Abs(21 - userTotal) < Math.Abs(21 - dealerTotal))
                {
                    return("user");
                }
            }
            if (userTotal <= 21 && userTotal == dealerTotal)
            {
                return("draw");
            }

            return("dealer");
        }