summaryrefslogtreecommitdiff
path: root/Game.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Game.hs')
-rw-r--r--Game.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/Game.hs b/Game.hs
index 7c5c8ba..816a65c 100644
--- a/Game.hs
+++ b/Game.hs
@@ -17,17 +17,17 @@ data Game = Game { players :: [Player]
}
-- | Begin new round of game.
-nextRound :: Int -> Game -> IO Game
-nextRound n game = do
+beginRounds :: Int -> Game -> IO Game
+beginRounds n game = do
if n == 0
then return game
else do
- game' <- nextTurn game
- nextRound (n - 1) game'
+ game' <- beginTurn game
+ beginRounds (n - 1) game'
-- | Let current player take their turn.
-nextTurn :: Game -> IO Game
-nextTurn game@(Game plyrs pidx att dir stock disc) = do
+beginTurn :: Game -> IO Game
+beginTurn game@(Game plyrs pidx att dir stock disc) = do
putStrLn $ replicate 80 '-'
putStrLn $ "Current attack: " ++ show att
decision <- prompt game
@@ -66,7 +66,7 @@ nextTurn game@(Game plyrs pidx att dir stock disc) = do
if null $ P.cards player'
then return game'
- else nextTurn game'
+ else beginTurn game'
-- | Prompt player to play a card (or draw card and skip turn).
prompt :: Game -> IO (Maybe Card)