Code Monkey home page Code Monkey logo

groovy-blackjack's Introduction

Groovy Blackjack

Image

My first Groovy script, a command-line Blackjack simulator.

Requirements

Created and tested with Java 6 and Groovy 1.8. I did have to be UTF-8 compliant for Mac OS X Terminal.

If executing the game from the command line rather than an IDE, follow the directions for installing Groovy and specify the directory for the card images:

Blackjack/src> groovy blackjack -d "../img"

Goals

Initially the goal was to create a simple Groovy command-line executable script to simulate casino-style Blackjack purely with text characters. As with all such things, I found that in fact it was a little more complex than I hoped, due to features like multiple decks, insurance, card graphics, splitting hands, a special rule when splitting Aces, etc.

So now I've created a Swing game panel that has graphical representation of the card hands for the dealer and player. The input at this time is still CLI-driven, but that may evolve as well.

Observations

When you are at a real casino, and you receive a 2 and Ace, the dealer will say "Three or Thirteen". This is only the illusion of choice. Algorithmically speaking, only when you introduce enough card values to put you over 21 is the Ace adjusted down to a value of 1.

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.