/cards

Primary LanguageJavaScript

Card Shuffler

Coding exercise exhibiting a card shuffler with sorting and filtering functionality.

Assignment requirements

Design an application that models a normal deck of 52 cards

  • Implement a method to shuffle the deck that does not use native random() function.
  • Get all cards with the same suit from a shuffled deck.
  • Order a shuffled deck in the following suit and card number (Diamonds A-K, Clubs A-K, Hearts A-K, Spades A-K).
  • Implement at your own sort method.
  • Write unit tests to for each method.

Quick Start

Prerequisites

The following is software is required for installation:

  • Node.js (used v10.7.0)
  • npm (used v6.2.0)

Installing

  1. Clone the project from Github:

SSH:

git clone git@github.com:SWeggboy/cards.git

HTTPS:

git clone https://github.com/SWeggboy/cards.git
  1. Install dependencies:
npm install

Running locally

Run the following on the command line:

npm start

Running the tests

All test files are located under __tests__. Run the following command to execute tests:

npm test