Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deck types and full card deck initialization in place, along tests
- Loading branch information
Rami Karjalainen
committed
Sep 7, 2011
1 parent
9c74713
commit d2bb4c1
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
module PokerCardEvaluator | ||
open Microsoft.FSharp.Reflection | ||
|
||
let dummyForTest = false | ||
type Suit = Heart | Diamond | Club | Spade | ||
type Card = | Ace of Suit | King of Suit | Queen of Suit | Jack of Suit | ||
| ValueCard of int * Suit | ||
|
||
let GetFullCardsForSuit suit = seq { yield Ace(suit); yield King(suit); yield Queen(suit); yield Jack(suit) | ||
for value in [2..10] do yield ValueCard(value, suit); } | ||
|
||
let GetDeck = Seq.map (fun c -> GetFullCardsForSuit c) >> Seq.concat | ||
let Deck = GetDeck [Heart;Diamond;Club;Spade] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters