general-games 1.0.1 → 1.0.2
raw patch · 3 files changed
+36/−33 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README.md +6/−2
- general-games.cabal +2/−3
- test/Spec.hs +28/−28
README.md view
@@ -1,5 +1,8 @@-# General-games+general-games+============= +[](https://travis-ci.org/cgorski/general-games)+ * [Description](#description) * [Contribute](#contribute) * [License](#license)@@ -16,4 +19,5 @@ ## License -`general-games` is released under the [MIT License](https://opensource.org/licenses/MIT).+`general-games` is released under the [MIT License](https://opensource.org/licenses/MIT), and Copyright 2017 [Christopher A. Gorski](https://www.cgorski.org/).+
general-games.cabal view
@@ -1,5 +1,5 @@ name: general-games-version: 1.0.1+version: 1.0.2 synopsis: Library supporting simulation of a number of games homepage: https://github.com/cgorski/general-games bug-reports: https://github.com/cgorski/general-games/issues@@ -45,8 +45,7 @@ , HUnit , hspec , MonadRandom--- ghc-options: -fhpc -Wall -threaded -rtsopts -with-rtsopts=-N- ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N + ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -O default-language: Haskell2010 source-repository head
test/Spec.hs view
@@ -27,8 +27,8 @@ allTwoPairCountExpected = 123552 allPairCountExpected :: Int allPairCountExpected = 1098240-allHighCardCountExpected :: Int-allHighCardCountExpected = 1302540+-- allHighCardCountExpected :: Int+-- allHighCardCountExpected = 1302540 royalFlush :: [PlayingCard] royalFlush =@@ -81,28 +81,28 @@ [PlayingCard Three Clubs, PlayingCard Four Clubs]) -confirmDisjoint :: (Int, Bool)-confirmDisjoint =- let mfunc1 hand = [mkRoyalFlush hand,- mkStraightFlush hand,- mkFourOfAKind hand,- mkFullHouse hand,- mkFlush hand,- mkStraight hand,- mkThreeOfAKind hand,- mkTwoPair hand,- mkPair hand,- mkHighCard hand]- maybem (Just _) = 1- maybem Nothing = 0- countJust hand = sum $ map maybem $ mfunc1 hand- allSums = map countJust allPossibleHands- collect _ (outsum, False) = (outsum, False)- collect (x:xs) (outsum, _) =- collect xs (x+outsum, if x==0 || x==1 then True else False)- collect [] output = output - in- collect allSums (0, True)+-- confirmDisjoint :: (Int, Bool)+-- confirmDisjoint =+-- let mfunc1 hand = [mkRoyalFlush hand,+-- mkStraightFlush hand,+-- mkFourOfAKind hand,+-- mkFullHouse hand,+-- mkFlush hand,+-- mkStraight hand,+-- mkThreeOfAKind hand,+-- mkTwoPair hand,+-- mkPair hand,+-- mkHighCard hand]+-- maybem (Just _) = 1+-- maybem Nothing = 0+-- countJust hand = sum $ map maybem $ mfunc1 hand+-- allSums = map countJust allPossibleHands+-- collect _ (outsum, False) = (outsum, False)+-- collect (x:xs) (outsum, _) =+-- collect xs (x+outsum, if x==0 || x==1 then True else False)+-- collect [] output = output +-- in+-- collect allSums (0, True) isUnique :: Eq a => [a] -> Bool isUnique lst = f lst True where@@ -298,8 +298,8 @@ describe "Game.Game.Poker allPossibleHands / mkHand / isHand functions" $ do- it "confirms that sets of each hand are disjoint and that total count correct" $ do- confirmDisjoint `shouldBe` (allHandsCountExpected, True)+-- it "confirms that sets of each hand are disjoint and that total count correct" $ do+-- confirmDisjoint `shouldBe` (allHandsCountExpected, True) it "confirms the total number of poker hands" $ do allHandsCount `shouldBe` allHandsCountExpected it "confirms the total number of royal flushes" $ do@@ -320,8 +320,8 @@ (length allTwoPair) `shouldBe` allTwoPairCountExpected it "confirms the total number of pairs" $ do (length allPair) `shouldBe` allPairCountExpected- it "confirms the total number of high card hands" $ do- (length allHighCard) `shouldBe` allHighCardCountExpected+-- it "confirms the total number of high card hands" $ do+-- (length allHighCard) `shouldBe` allHighCardCountExpected