Оценить:
 Рейтинг: 4

Справочник Жаркова по проектированию и программированию искусственного интеллекта. Том 8: Программирование на Visual C# искусственного интеллекта. Издание 2. Продолжение 1

Год написания книги
2023
Теги
<< 1 ... 25 26 27 28 29 30 31 32 33 ... 38 >>
На страницу:
29 из 38
Настройки чтения
Размер шрифта
Высота строк
Поля

}

}

/// <summary>

/// Computes the score of the hand

/// </summary>

/// <returns>the value of the score</returns>

public int BlackJackScoreHand()

{

int score = 0;

int aces = 0;

foreach (Card card in this)

{

score += card.BlackJackScore;

if (card.BlackJackScore == 11)

{

aces++;

}

}

while ((score > 21) && (aces > 0))

{

score -= 10;

aces–;

}

return score;

}

}

/// <summary>

/// Contains a number of card decks

/// which can be dealt one at a time.

/// </summary>

public class CardShoe

{

private int noOfDecks = 1;

private byte[] decks;

private int nextCard;

private bool testShoe = false;

/// <summary>

/// True if the deck is "stacked",

/// i.e. was created from a byte array

/// </summary>

public bool TestShoe

{

get

{

return testShoe;

}

}

private void makeShoe()

{

decks = new byte[noOfDecks * 52];
<< 1 ... 25 26 27 28 29 30 31 32 33 ... 38 >>
На страницу:
29 из 38

Другие электронные книги автора Валерий Алексеевич Жарков