diff options
author | Frederick Yin <fkfd@fkfd.me> | 2023-01-11 17:26:29 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2023-01-11 17:26:29 +0800 |
commit | b1540b05e9ccdd644a6801593712b7da950386e8 (patch) | |
tree | 078f821cac7b0cfaa57060fad992ea2d8d639d33 /Main.hs | |
parent | 7f34eef9fb39824ea5457368db593adca7b5c30b (diff) |
Move game setup out of Main
Diffstat (limited to 'Main.hs')
-rw-r--r-- | Main.hs | 42 |
1 files changed, 8 insertions, 34 deletions
@@ -1,38 +1,12 @@ -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 +import Game (Game(..), Setup(..), beginGame) 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 3 True $ dealCards 6 game + let setup = Setup { playerN = 3 + , roundN = 3 + , deckN = 2 + , cardN = 6 + , autoMode = True + } + beginGame setup return () |