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

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

Год написания книги
2023
Теги
<< 1 ... 13 14 15 16 17 18 19 20 21 ... 38 >>
На страницу:
17 из 38
Настройки чтения
Размер шрифта
Высота строк
Поля

void showPot()

{

this.Text =

"Bank: " + pot.PotValue.ToString() + " Bet: " +

pot.BetValue.ToString();

}

void startPlay()

{

//We commented out in the original:

//pot.DoPlaceBet();

//We write in the original:

if (mode == GameMode.PlayerBust && mode == GameMode.DealerWon)

pot.DoPlaceBet();

showPot();

// clear the hands

playerHand.Clear();

dealerHand.Clear();

// deal the face down hole card

dealerHoleCard = shoe.DealCard();

dealerHoleCard.FaceUp = false;

dealerHand.Add(dealerHoleCard);

// deal the first player card

playerHand.Add(shoe.DealCard());

// deal the second dealer card (face up)

dealerHand.Add(shoe.DealCard());

// deal the second player card

playerHand.Add(shoe.DealCard());

if ((dealerHand.BlackJackScoreHand() == 21) &&

(playerHand.BlackJackScoreHand() != 21))

{

//We write in the original:

pot.DoPlaceBet();

pot.HouseWins();

showPot();

//Discontent of support group with our exceeding of

//cards:

Assembly a2 = Assembly.GetExecutingAssembly();

Stream s2 =

a2.GetManifestResourceStream("PocketJack.pj_busted.wav");

SoundPlayer player2 = new SoundPlayer(s2);

player2.Play();

dealerHoleCard.FaceUp = true;

mode = GameMode.DealerWon;

return;

}

if ((playerHand.BlackJackScoreHand() == 21) &&

(dealerHand.BlackJackScoreHand() != 21))

{

pot.PlayerWins();

showPot();
<< 1 ... 13 14 15 16 17 18 19 20 21 ... 38 >>
На страницу:
17 из 38

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