Giter VIP home page Giter VIP logo

blackjack-basic-strategy's Introduction

Blackjack Basic Strategy

What the program does

Play Blackjack with your friends (locally) right on the terminal!

Each time a move is made, the program will let you know if the decision you made is the correct one, according to the Blackjack Basic Strategy chart.

Demonstration

Basic round: demo.gif

Just like in real life, you can split your cards: demo2.gif

Blackjack rules

  • You can hit and stand as long as you haven't bust
  • You can double down only in your first hand
  • You can split your cards (4 splits max [This is fairly standard])
  • Dealer stops at soft 17
  • You can ask for insurance if the dealer has an ace (No insurance is offered with a 10)
    • Insurance is worth half your bet
  • If the dealer has Blackjack, play is suspended (If a player did ask for insurance, they'll be rewarded)
  • There's no surrender (Although it could be implemented)

How to install

Just clone the repository and run:

make

Charts

Hard Hands

2 3 4 5 6 7 8 9 10 A
5 Hit Hit Hit Hit Hit Hit Hit Hit Hit Hit
6 Hit Hit Hit Hit Hit Hit Hit Hit Hit Hit
7 Hit Hit Hit Hit Hit Hit Hit Hit Hit Hit
8 Hit Hit Hit Hit Hit Hit Hit Hit Hit Hit
9 Hit Double Down Double Down Double Down Double Down Hit Hit Hit Hit Hit
10 Double Down Double Down Double Down Double Down Double Down Double Down Double Down Double Down Hit Hit
11 Double Down Double Down Double Down Double Down Double Down Double Down Double Down Double Down Double Down Double Down
12 Hit Hit Stand Stand Stand Hit Hit Hit Hit Hit
13 Stand Stand Stand Stand Stand Hit Hit Hit Hit Hit
14 Stand Stand Stand Stand Stand Hit Hit Hit Hit Hit
15 Stand Stand Stand Stand Stand Hit Hit Hit Hit Hit
16 Stand Stand Stand Stand Stand Hit Hit Hit Hit Hit
17 Stand Stand Stand Stand Stand Stand Stand Stand Stand Stand
18 Stand Stand Stand Stand Stand Stand Stand Stand Stand Stand
19 Stand Stand Stand Stand Stand Stand Stand Stand Stand Stand
20 Stand Stand Stand Stand Stand Stand Stand Stand Stand Stand
21 Stand Stand Stand Stand Stand Stand Stand Stand Stand Stand

Soft Hands

2 3 4 5 6 7 8 9 10 A
A,2 Hit Hit Hit Double Down Double Down Hit Hit Hit Hit Hit
A,3 Hit Hit Hit Double Down Double Down Hit Hit Hit Hit Hit
A,4 Hit Hit Double Down Double Down Double Down Hit Hit Hit Hit Hit
A,5 Hit Hit Double Down Double Down Double Down Hit Hit Hit Hit Hit
A,6 Hit Double Down Double Down Double Down Double Down Hit Hit Hit Hit Hit
A,7 Stand Double Down Double Down Double Down Double Down Stand Stand Hit Hit Hit
A,8 Stand Stand Stand Stand Stand Stand Stand Stand Stand Stand
A,9 Stand Stand Stand Stand Stand Stand Stand Stand Stand Stand

Split hands

2 3 4 5 6 7 8 9 10 A
2,2 Split Split Split Split Split Split Hit Hit Hit Hit
3,3 Split Split Split Split Split Split Hit Hit Hit Hit
4,4 Hit Hit Hit Split Split Hit Hit Hit Hit Hit
5,5 Double Down Double Down Double Down Double Down Double Down Double Down Double Down Double Down Hit Hit
6,6 Split Split Split Split Split Hit Hit Hit Hit Hit
7,7 Split Split Split Split Split Split Hit Hit Hit Hit
8,8 Split Split Split Split Split Split Split Split Split Split
9,9 Split Split Split Split Split Stand Split Split Split Split
T,T Stand Stand Stand Stand Stand Stand Stand Stand Stand Stand
A,A Split Split Split Split Split Split Split Split Split Split

TODO:

  • Make it so that the program takes into account the running/true count, in order to practice Card Counting
    • This shouldn't be too hard to do

Asterisks:

1: This is the first time I write anything in C. The code isn't the cleanest. I'll probably refactor stuff later on. There are messy things in the source code. I just wanted to finish it

  1. Enjoy ^_^

blackjack-basic-strategy's People

Contributors

lima-limon-inc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.