Skat Engine und AI auf Haskell Basis
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
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)