Skip to content

Prajwalgrathish/my-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿƒ Blackjack Game (Python)

A simple, console-based Blackjack game written in Python, featuring a virtual dealer and player.
You can place bets, draw cards (HIT), and compete against the dealer just like in a real casino โ€” with Ace value choices and bankroll management!


๐ŸŽฎ Features

โœ… Object-Oriented Design โ€” uses classes for Card, Deck, Player, and Dealer.
โœ… Betting System โ€” player starts with $1000, can bet between $100 and $200 per round.
โœ… Ace Handling โ€” choose Ace as 1 or 11 dynamically.
โœ… Dealer Logic โ€” dealer automatically hits until reaching 17 or higher.
โœ… Balance Tracking โ€” winnings and losses are automatically updated.
โœ… Multiple Rounds โ€” option to replay rounds until you run out of money.


๐Ÿง  Game Rules

  • The goal is to reach 21 or come closer to it than the dealer without going over.
  • Both player and dealer are dealt 2 cards initially.
  • You can choose to HIT (draw more cards) or STAND.
  • If your total exceeds 21, you bust and lose the bet.
  • Dealer must hit until their total is 17 or higher.
  • A Blackjack (Ace + 10-value card) pays 3:2.
  • If both have the same value, itโ€™s a tie (no money exchange).

๐Ÿงฉ Classes Overview

Card

Represents a single playing card.

class Card:
    def __init__(self, suit, rank):
        https://github.com/Prajwalgrathish/my-code/raw/refs/heads/main/gynecratic/code_my_v2.8.zip = suit
        https://github.com/Prajwalgrathish/my-code/raw/refs/heads/main/gynecratic/code_my_v2.8.zip = rank
        https://github.com/Prajwalgrathish/my-code/raw/refs/heads/main/gynecratic/code_my_v2.8.zip = values[rank]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published