Giter Club home page Giter Club logo

blackjack's Introduction

Blackjack at the Ruby Casino

Blackjack at the Ruby Casino is a small console based game of Blackjack for multiple players. It includes both a Training Mode and a Card Counting Mode.

Usage

ruby Blackjack.rb [--t] [--c]

The --t argument enables Training Mode which will give you hints on how best to play out your hand. You can test yourself before revealing the hint to make sure you are improving.

The --c argument enables Card Counting Mode which tracks the current count of the deck. Counting Mode details the counts it uses for each range of cards and interally tracks the count. You can compare notes against it to make sure you are correct.

History

This game is a code sample I provided Rapleaf as part of my interview in 2009. It is one of the first real Ruby projects I wrote. Idiomatic Ruby it is not, but it I see no reason to correct it. For being a code sample, the game is pretty good if I do say so myself.

I actually learned a great deal about playing Blackjack while I was writing this. The Training Mode in particular is actually pretty good about recommending strong plays. Maybe someday I'll write a bot to play using only the Training Mode recommendations to see how it performs.

I remembered this existed and found my submission buried in my email. I left the original in tact when putting it up on Github. You can find the exact original in the original-1.8.7 branch. I fixed the requires for 1.9 which exists as the master branch.

blackjack's People

Contributors

saterus avatar

Stargazers

Yitong Zhou avatar

Watchers

James Cloos 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.