A simple web application that will take in a user defined number of players and deal out a shuffled, standard deck of cards. The shuffle method used is the Fisher-Yates algorithm.
- Ability to pass in a number of players.
- A new deck of cards is created and shuffled.
- The deck is then distributed card by card to each player and displayed on the screen.
The underlying cardDeck class and implementation are using ES6 standards.
Due to the class and implementation using ES6 standards Babel was need to transpile the ES6 code to ES2015 so that it can be understood by the browser.
Combines the output from Babel into a single Javascript file. This is needed because the export and requires included in those files could not communicate if they were not in the same file.
A simple tool used to start a service pointing to the index.html and defaults to localhost:8080.
Used to unit test the cardDeck class.
In order to contribute to this repository the following build steps will need to be followed, using Babel, Browserify and HTTP-Server.
When making changes to either the cards.js or main.js you will need to transpile the code with Babel to get it to the point that we can then use Browserify.
npm run babel
With the changes transpiled to ES2015 standards by Babel. This build step will combine both files into a single file referenced by index.html.
npm run browser
Once all changes have been built and you are ready to see your changes running this command will start a new service defaulted to localhost:8080 to test the changes.
npm run start
To run the unit tests run the following command.
npm run test
* Initial Release
* Added ability to define a number of players
* Added ability to shuffle and deal a standard 52 card deck
* Added ability to deal to a user defined number of players
* Added ability to display each player's hand to the end user