introduce stack build system and restructure code

This commit is contained in:
2019-08-26 11:46:20 +02:00
parent da217b5196
commit 08e94e4386
25 changed files with 762 additions and 163 deletions
+18
View File
@@ -0,0 +1,18 @@
module Skat.AI.Stupid where
import Skat.Player
import Skat.Pile
import Skat.Card
data Stupid = Stupid { getTeam :: Team
, getHand :: Hand }
deriving Show
instance Player Stupid where
team = getTeam
hand = getHand
chooseCard p _ _ hand = do
trumpCol <- trumpColour
turnCol <- turnColour
let possible = filter (isAllowed trumpCol turnCol hand) hand
return (head possible, p)