From e9405365b1d19aef2c0bbf0e66476be9e556c384 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Sat, 14 Jan 2023 11:58:36 +0800 Subject: Reset game state after each round --- Player.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Player.hs') diff --git a/Player.hs b/Player.hs index ec4d180..3bec60c 100644 --- a/Player.hs +++ b/Player.hs @@ -36,6 +36,11 @@ showCards (Player _ _ cs) prev att = else Color.red $ join n c join n c = (show n) ++ ". " ++ (C.showCard c) +-- | Empty all players' cards. +clearCards :: [Player] -> [Player] +clearCards plyrs = map clear plyrs + where clear (Player n p _) = Player n p [] + -- | Update penalty for each player after a round. calcPenalties :: [Player] -> [Player] calcPenalties plyrs = map penalize plyrs -- cgit v1.2.3