add preconfigured matches and extend online ai

This commit is contained in:
2019-08-28 16:27:24 +02:00
parent 409ef29da1
commit 7138f74e8e
8 changed files with 66 additions and 101 deletions
+25
View File
@@ -0,0 +1,25 @@
module Skat.Matches (
singleVsBots
) where
import Control.Monad.State
import Skat
import Skat.Operations
import Skat.Player
import Skat.Pile
import Skat.Card
import Skat.AI.Rulebased
import Skat.AI.Online
import Skat.AI.Stupid
singleVsBots :: (Team -> Hand -> OnlineEnv) -> IO ()
singleVsBots mkPlayer = do
cards <- liftIO $ shuffleCards
let ps = Players
(PL $ mkPlayer Team Hand1)
(PL $ Stupid Team Hand2)
(PL $ mkAIEnv Single Hand3 10)
env = SkatEnv (distribute cards) Nothing Spades ps
liftIO $ evalStateT (turn Hand1 >>= publishGameResults) env