Amazing-Python-Scripts

Форк
0

4 года назад
README.md

Blackjack

Blackjack (also known as 21) is a multiplayer card game, with fairly simple rules.

For this script, I am implementing a simplified version where a user can play against the computer who acts as dealer.

Two cards are dealt to each player. The dealer shows one card face up, and the other is face down. The player gets to see both of his or her cards and the total of them is added.

Aces are worth 1 or 11 points, and all other cards are worth their face value. The goal of the game is to get as close to 21 (“blackjack”) without going over (called “busting.”)

The human player goes first, making his or her decisions based on the single dealer card showing.


The player has two choices: Hit or Stand.

  • Hit means to take another card.
  • Stand means that the player wishes no more cards, and ends the turn, allowing for the dealer to play.

The dealer must hit if their card total is less than 17, and must stand if it is 17 or higher.

Whichever player gets closest to 21 without exceeding it, wins.


Example Run

demo demo

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.