Skip to content

jonathan-buttner/deckofcards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Deck of cards implementation

This library implements a deck of cards with the ace as high (valued greater than King). The Ace class can be instantiated as low or high. The PokerDeckBuilder creates a deck with the ace as high.

Project Layout

Design

My hope was to make the library extensible to allow other types of decks to easily be created. For example if the ace needs to be low, a different PokerDeckBuilder function could be added to support that.

I decided not to unit test the randomness of shuffle but instead that it swaps cards as expected. For better testability, the StandardDeck class takes a NumberGenerator to allow shuffle's functionality to be predictable.

The shuffle and dealOneCard methods are implemented in StandardDeck.

To Use

I used Intellij IDE to develop the project and was able to include it in another project by adding it as a module.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages