Skip to content

A simple command-line Blackjack game in Python where you play against the computer. The game includes card drawing, score calculation, and basic Blackjack rules.

Notifications You must be signed in to change notification settings

ayovz/Py-Blackjack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿƒ Blackjack - Python CLI Game

Welcome to Blackjack, a simple command-line implementation of the classic card game written in Python.

Play against the computer, draw cards, and try to get as close to 21 as possible without going over!


๐ŸŽฎ Features

  • Terminal-based game with interactive input
  • Basic Blackjack rules:
    • Automatic Ace handling (11 or 1)
    • Win conditions include Blackjack, bust, and score comparison
  • ASCII art title
  • Replayable game loop
  • Clean and cross-platform screen clearing

๐Ÿ›  Requirements

  • Python 3.6 or higher
  • No external libraries needed

โ–ถ๏ธ How to Play

  1. Clone or download the repo:

    git clone https://github.com/your-username/Py-Blackjack.git
    cd Py-Blackjack
  2. Run the game: python blackjackmain.py

  3. Follow on-screen instructions to:

    • Draw another card by typing y
    • Stand by typing n
    • Decide whether to play again after each round

๐Ÿ“ Example Output

Welcome to Blackjack!
Press Enter to start the game...

.------..------..------..------..------..------..------..------..------.
|B.--. ||L.--. ||A.--. ||C.--. ||K.--. ||J.--. ||A.--. ||C.--. ||K.--. |
| :(): || :/\: || (\/) || :/\: || :/\: || :(): || (\/) || :/\: || :/\: |
| ()() || (__) || :\/: || :\/: || :\/: || ()() || :\/: || :\/: || :\/: |
| '--'B|| '--'L|| '--'A|| '--'C|| '--'K|| '--'J|| '--'A|| '--'C|| '--'K|
`------'`------'`------'`------'`------'`------'`------'`------'`------'

Your cards: [10, 7], current score: 17
Computer's first card: 9
Type 'y' to draw another card, or 'n' to stand: n

--------------- Final Results ---------------
Your cards: [10, 7], final score: 17
Computer's cards: [9, 8], final score: 17
DRAW

๐Ÿ“ File Structure

Py-Blackjack/
โ”‚
โ”œโ”€โ”€ blackjackmain.py   # Main game file
โ”œโ”€โ”€ README.md      # You're reading it!

๐Ÿ“š Blackjack Rules Summary

  • Cards 2-10 = face value
  • Face cards (J, Q, K) = 10
  • Aces = 11 (or 1 if it helps avoid busting)
  • Blackjack = exactly 21 with 2 cards
  • If the computer or player goes over 21 = bust
  • Computer draws until it reaches 17 or more

๐Ÿ“œ License

This project is licensed under the MIT License.

๐Ÿค Contributing

Want to improve the game? Feel free to fork and submit pull requests. You can add:

Card graphics

Score tracking

Multiplayer support

GUI version with Tkinter or Pygame

Enjoy the game and beat the dealer! ๐ŸŽ‰

Made with love.

About

A simple command-line Blackjack game in Python where you play against the computer. The game includes card drawing, score calculation, and basic Blackjack rules.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages