This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## initiate game | |
print( | |
'\n' * 100 + | |
'#' * 16 + | |
'\n\nSIMPLE BLACKJACK' + | |
'\nby Craig Janis\n' + | |
'\nOverview: You start with two cards\nand decide whether to "hit" (ask\nfor another card) or "stand" (end\nyour turn with the cards you\nalready have). The dealer starts\nwith one card visible and one\ncard face down, and after your\nturn, the dealer will have a\nchance to hit or stand. You win\nif you end the game with more\npoints the dealer, but fewer\nthan 21 points. If you go over 21\npoints, that\'s called a "bust".\nTies go to the Dealer.\n\n' + | |
'#' * 16 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import random | |
deck = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]*4 | |
def deal(deck): | |
hand = [] | |
for i in range(2): | |
random.shuffle(deck) | |
card = deck.pop() |