Skip to content

conan/cards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#Specification

Please write a representation of a deck of cards.

The Deck class should contain three public methods:

// shuffles the deck  
public void shuffle();

// draw a number of cards from the deck.  The end result is that the cards returned are removed from the deck.  
public List<Card> draw(int howMany);

// draw a number of cards from the deck in sorted order.  The end result is that the cards returned are removed 
// from the deck.  
public List<Card> drawSorted(int howMany);
  • Cards should be first sorted by suit and then by face value (where aces are always high).
  • Please include unit tests. Using Maven for dependency management would yield some Brownie points!
  • Please package all relevant source, libraries and configuration and send this back to us.

Notes

  • There is no support for jokers
  • A better data structure for a deck would be a Deque, but the functionality it adds was not required by the spec
  • It's probably possible to game the pseudo-random shuffling method
  • drawSorted() isn't really needed - the CardComparator class is more versatile

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published