Skat Engine und AI auf Haskell Basis
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 line
435B

  1. module AI.Stupid where
  2. import Player
  3. import Pile
  4. import Card
  5. data Stupid = Stupid { getTeam :: Team
  6. , getHand :: Hand }
  7. deriving Show
  8. instance Player Stupid where
  9. team = getTeam
  10. hand = getHand
  11. chooseCard p _ _ hand = do
  12. trumpCol <- trumpColour
  13. turnCol <- turnColour
  14. let possible = filter (isAllowed trumpCol turnCol hand) hand
  15. return (head possible, p)