diff options
author | Frederick Yin <fkfd@fkfd.me> | 2023-01-05 20:59:02 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2023-01-05 20:59:02 +0800 |
commit | 79fba8934969b660298e3a2c875a49d500313d1a (patch) | |
tree | 8a32d01c68a64323e079ee428dd4a74e7f003d58 /Main.hs | |
parent | 8642b92029e8e7072d18fa04f90ee59f7ac3d933 (diff) |
Prompt for card to play
Diffstat (limited to 'Main.hs')
-rw-r--r-- | Main.hs | 31 |
1 files changed, 30 insertions, 1 deletions
@@ -1,6 +1,35 @@ import System.Random (getStdGen) import Card (fullDecks, showCard, shuffle) +import Game (Game(..), + Direction(CCW, CW), + players, + playerIdx, + attack, + direction, + stockPile, + discardPile, + prompt, + ) +import Player (Player(..)) +import qualified Player as P +import Card (Card) +import qualified Card as C +main :: IO () main = do gen <- getStdGen - print $ map showCard $ shuffle gen $ fullDecks 2 + let stock = shuffle gen $ fullDecks 2 + let discard = [] + let defaultPlayers = [ Player "Alice" 0 $ take 6 $ fullDecks 1 + , Player "Bob" 0 $ take 6 $ fullDecks 1 + , Player "Carol" 0 $ take 6 $ fullDecks 1 + ] + let game = Game { players = defaultPlayers + , playerIdx = 0 + , attack = 0 + , direction = CCW + , stockPile = stock + , discardPile = discard + } + card <- prompt game + print card |