Skip to content

shefaligupta/deck-of-cards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Deck of Cards

Given Problem Statement:

Write a simple class in the language of your choice to represent a deck of cards with operations to shuffle the deck and to deal one card. While not a requirement today, a likely future enhancement is the need to deal all the cards in a deck.

My Solution:

I have used ES6 to represent the class of deck and its function shuffle and deal.

Demo: https://shefaligupta.github.io/deck-of-cards/demo/

Test Cases: Open console to see test messages (described in PASS/FAIL).

Shuffle Cards: When the html file is opened, you will see a shuffle cards button and ordered cards. Hit the button to display the shuffled cards.

How are cards shuffled: We find a random number from the deck of cards and swap the card from that index.

Deal Card: Deal card will always pick the top card of the stack. A card will be shown when you hit deal card button on the screen.

Screenshot: Screenshot

About

Test Assignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published