UM CSCI 151- Python 2
This is a console-based version of Blackjack built in Python, simulating classic casino rules. It features a full betting system, natural blackjack detection, reshuffling, and player/dealer interactions.
class Card:
"""Represents a single playing card in a standard 52-card deck."""
def __init__(self, suit, face, value):
self.suit = suit
self.face = face
self.value = value
def get_value(self):
return self.value
def __str__(self):
return f"{self.face} of {self.suit}"
if self.player.blackjack():
if self.dealer.blackjack():
print("Push: Both you and the dealer have blackjack.")
self.player.win(bet_amount)
else:
print("Blackjack! You win 3:2 payout.")
self.player.win(int(bet_amount * 2.5))
This project solidified my understanding of object-oriented programming and control flow. I implemented recursive logic for Ace evaluation and handled edge cases like dealer ties and re-shuffling logic. In future updates, I could expand the interface to support multiple players or add a graphical UI.