19 lines
455 B
Haskell
19 lines
455 B
Haskell
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)
|