0
comment
comment
on 8/14/2015 8:47 AM
In part one of this series we walked through modeling the domain of our card game. In this post we'll use that domain as a guide to help us create a deck, shuffle the deck, and deal cards from the deck.
Creating the deck
There may be more elegant ways to do this, but for now we'll simply define a value and populate it with the cards.
let newDeck =
[(Two, Spades); (Three, Spades); (Four, Spades); (Five, Spades);
(Six, Spades); (Seven, Spades); (Eight, Spades); (Nine, Spades);
(Ten, Spa[...]