add ai system and a decent simulation based ai

This commit is contained in:
Christian Merten
2019-05-08 20:17:30 +02:00
parent 62bef68e45
commit 10099310c4
14 changed files with 699 additions and 60 deletions
+18
View File
@@ -0,0 +1,18 @@
module Player.Utils (
isAllowed, isTrump
) where
import Player
import qualified Card as C
import Card (Card)
isAllowed :: MonadPlayer m => [Card] -> Card -> m Bool
isAllowed hand card = do
trCol <- trumpColour
turnCol <- turnColour
return $ C.isAllowed trCol turnCol hand card
isTrump :: MonadPlayer m => Card -> m Bool
isTrump card = do
trCol <- trumpColour
return $ C.isTrump trCol card