Giter Site home page Giter Site logo

blackjack-web's Introduction

Blackjack

Built using React. This is a small demo project that allows you to play a game of blackjack.

How to run:

  • Clone or download the project.
  • yarn install or npm install
  • yarn start or npm start

Testing:

  • yarn test or npm test

Developer notes:

This project uses redux for state managemnt. This is likely overkill, however it is something I am comfortable using at the moment.

My testing approach currently falls in line with how Kent C Dodds describes in this blog post. While I am not married to this style, I feel it works well for the apps I currently work on.

For this project, I have opted to use css modules for styling components for simplicity and to take advantage of stylelint to produce a consistent style format.

Potential improvements / additions

  • Currency: Adding the ability for the user to 'bid' an amount of currency when choosing to bid.
  • Handle a 'draw' scenario.
  • Animation / actual card images.
  • Adding the ability to 'split' cards when the player is dealt a double.
  • Prevent the deck from re-shuffling between each 'round' and going through the full 52 cards if the user keeps playing.

E2E Testing:

I wrote a very short end-to-end test on the daniel/testcafe branch. Testcafe is a tool that was recommended to me for this purpose. Note: this currently is targetting only Google Chrome. Either have Chrome installed, or change the testcafe chrome part of package.json to use the browser of your choice.

In order to try this out:

  • Swap to the daniel/testcafe branch.
  • Run yarn install.
  • In another terminal, run yarn start.
  • Run yarn run testcafe.

blackjack-web's People

Contributors

ddeak 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.