Created
December 26, 2018 18:18
-
-
Save mvaldesdeleon/390344d3ebdb6dbe98f2c03fd4479733 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Player = Player | |
{ _name :: String | |
, _hitPoints :: Integer | |
, _attackPoints :: Integer | |
} | |
type Game = [Player] | |
playerTurn :: Player -> State Game () | |
playerTurn p = do | |
-- be careful with p here! | |
return () | |
turn :: State Game () | |
turn = do | |
players <- get | |
mapM_ playerTurn players |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment