GR.Gambling.Blackjack.CardSet.ToCountsString C# (CSharp) Method

ToCountsString() public method

public ToCountsString ( ) : string
return string
        public string ToCountsString()
        {
            StringBuilder result = new StringBuilder();

            for (int i = 0; i < card_counts.Length; i++)
            {
                if (i>0) result.Append(" ");
                result.Append(card_counts[i]);
            }

            return result.ToString();
        }

Usage Example

Example #1
0
        public override string ToString()
        {
            StringBuilder result = new StringBuilder();

            result.AppendLine("Shoe: " + shoe.ToCountsString());
            result.AppendLine();

            result.Append(string.Format("Dealer:   {0,-12} = {1}", dealer_hand, dealer_hand.PointCount()));
            if (dealer_hand.IsNatural())
            {
                result.Append(" (BJ)");
            }
            if (dealer_hand.IsBust())
            {
                result.Append(" (busted)");
            }
            result.AppendLine();

            result.AppendLine();

            result.AppendLine(player_handset.ToString());

            return(result.ToString());
        }