Skip to content

Instantly share code, notes, and snippets.

View bettybel's full-sized avatar

Bett bettybel

View GitHub Profile
@cjanis
cjanis / blackjack.py
Created May 8, 2018 03:24
A simple blackjack game built with Python
## 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
)
@mjhea0
mjhea0 / python_blackjack.py
Last active February 5, 2025 14:32
python blackjack
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()