summaryrefslogtreecommitdiff
path: root/Main.hs
blob: 70c9df78621582fcf2bfd3f8be365d093ebea9ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import System.Random (getStdGen)
import Card (fullDecks, showCard, shuffle)
import Game (Game(..),
             players,
             playerIdx,
             attack,
             direction,
             stockPile,
             discardPile,
             prompt,
             dealCards,
             beginRounds,
            )
import Player (Player(..))
import qualified Player as P
import Card (Card)
import qualified Card as C

main :: IO ()
main = do
    shuffleGen <- getStdGen
    let stock = shuffle shuffleGen $ fullDecks 2
    let discard = []
    let defaultPlayers = [ Player "Alice" 0 []
                         , Player "Bob"   0 []
                         , Player "Carol" 0 []
                         ]
    let game = Game { players     = defaultPlayers
                    , playerIdx   = 0
                    , attack      = 1
                    , direction   = 1
                    , prevCard    = head stock
                    , stockPile   = tail stock
                    , discardPile = discard
                    }

    beginRounds 1 False $ dealCards 6 game
    print ()