May 16, 2019 by Programmingassignmenthelper
My very first assignment at University was to program a game of 21, although it was a cut down version. The assignment was in Pascal, so I have converted the code into Python to demonstrate a simple assignment. The basic rules of BlackJack (21, Pontoon) are that you have a deck of cards, and face cards count as 10 (Jack, Queen, King), and the Ace can count as 1 or 11. You see your cards, but not the dealers (you see one of the dealers cards) and you decide whether to stop where you are or to draw a new card. Once you have finished, the dealer takes their turn, and will draw if the value of the hand is less than 17. I’ve not included comments in the code, but I would do if it was a real assignment.
# Blackjack (21 or Pontoon)