A deck comprises 52 cards of 4 suits (spades, hearts, clubs, and diamonds). Each suit has 13 cards of values from 2-10, Jack, Queen, King, and Ace.
Write a class to represent a card. The class should have a suit and value property indicating its suit and value.
Write a class that has a draw method.
- The draw method should accept an integer as an argument.
- The draw method should return an array of card objects.
- The array should have as many card objects as specified by the integer argument.
- Each card should be different.
- Calling draw multiple times should result in unique cards across each draw invocation.
- When draw is called and there aren't enough cards remaining in the deck to satisfy the requirement the draw method should return an empty array
Some tests you could write for this are:
- calling draw on a deck results in the specified number of cards
- calling draw on a deck with a number higher than the remaining cards results in an empty array being returned
- each card returned from draw is different