Skip to content

A class design solution for deck of cards. Includes operations like shuffle and deal.

Notifications You must be signed in to change notification settings

santosh719/DeckOfCards

Repository files navigation

Deck Of Cards

Deck of Cards ( Design Problem)

52 cards with:

● 4 suits: hearts​, spades​, clubs​, diamonds

● Face values of: Ace​, 2-10​, Jack​, Queen​, and King​).

shuffle​() - shuffle returns no value, but results in the cards in the deck being randomly permuted.

dealOneCard()​ - returns one card from the deck to the caller. Specifically, a call to shuffle() followed by 52 calls to dealOneCard() should result in the caller being provided all 52 cards of the deck in a random order. If the caller then makes a 53rd call dealOneCard(), no card is dealt.

Usage

The test class contains the main method which can be called to test all the functionality. All the java files are in src/main/java.

About

A class design solution for deck of cards. Includes operations like shuffle and deal.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published