Skip to content

Instantly share code, notes, and snippets.

@mvaldesdeleon
Created December 26, 2018 18:18
Show Gist options
  • Save mvaldesdeleon/390344d3ebdb6dbe98f2c03fd4479733 to your computer and use it in GitHub Desktop.
Save mvaldesdeleon/390344d3ebdb6dbe98f2c03fd4479733 to your computer and use it in GitHub Desktop.
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