Giter VIP home page Giter VIP logo

blackjack-python's Introduction

Requirements

This terminal-based Blackjack game is written in Python 3. The only required library is random, which comes with the Python standard library, so no additional installation is needed. To begin playing, simply execute python3 blackjack.py.

Gameplay

The game implements the standard rules of Blackjack. Any expected inputs are indicated by in-game prompts. Currently, the game tallies totals the number of rounds won by the player and (electronic) dealer to determine a winner. Gameplay ends when there are no more cards to be dealt; the player has the option of specifying how many standard decks to play with.

Design

Python's random library is used to simulate the shuffling of cards. The calculation of card and hand values is partitioned into functions to keep the calculations for "soft hands" (the dual value of Aces) clean. The string display formatting of cards is also partitioned into functions so as to keep the separation between verbosity modes (i.e. "JH" vs. "Jack of Hearts", decided by the user) clean.

Features for the future

I haven't had much time to work on the current version of the game, but with more time, I would like to incorporate (in rough order of priority):

  • Placement of monetary bets
  • "Splitting pairs" and "doubling down", additional options in a blackjack game
  • Modification of the game's terminal outpu, to make it aesthetically more streamlined for the player (perhaps using carriage returns or real-time delays in between player and dealer turns)
  • A multiplayer option

Have fun playing!

blackjack-python's People

Contributors

jonathanchu33 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.