Giter Site home page Giter Site logo

blackjack's Introduction

Blackjack rules used :

If player gets blackjack, payment is 3:2.
If dealer and player both get blackjack then dealer pushes the deal back - player neither gains nor looses.
If dealer bursts, player/s who had not burst will get 1:1 payment.
If player bursts, irrespective of dealers status(blackjack or burst), player looses money.


Action options :

Hit(1)          => draw card
Stay(0)         => do nothing
DoubleDown(2)   => doubles the bet and can draw only one card, available only on first hand
Split(3)        => if both the cards from a hand are of same value then can split this hand into
                    two hands and add additional bet amount as of original hand.
Surrender(4)    => no card draw but can save half of the bet if dealer hand is too strong
                    than what you have, available only on first hand


Execution steps:

1. Create virtual environment (python3) and install requirements.txt.
2. Execute run.py.
3. Enter the number of players (num of card decks will be calculated as per numplayers- considering a deck for upto 4 players).
4. Enter betting amount for every player (min 100,max 1000).
5. In each player's turn, check the corresponding hand's cards and dealer's one visible card
   and then select available options tomaximize sum upto 21.
6. If dealer or player cards sum > 21 then burst => loose bet amount, if sum = 21 then Blackjack -> wins 3:2 of bet amount
   and if no blackjack or burst then comapre with dealer hand value and either get 1:1 money of bet amount or loose.

blackjack's People

Contributors

kul-amr 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.