--------------------------------------------------

-- | Read a Level from a file.
readLevel :: String -> IO Level
readLevel filename = do
  map <- readFile filename
  let map' = strsToLevel (lines map)
  return map'

{-|
  Read a String representation of a map and convert
  it to the internal Level structure.

  Key:

   * '#' = Wall

   * '_' = Goal

   * 'O' = Block

   * '@' = Player starting location
-}
readLevel :: String -> IO Level
readLevel filename = do
  map <- readFile filename
  let map' = strsToLevel (lines map)
  return map'

{-|
  Read a String representation of a map and convert
  it to the internal Level structure.

  Key:

   * '#' = Wall

   * '_' = Goal

   * 'O' = Block

   * '@' = Player starting location
-}
readLevel filename = do
  map <- readFile filename
  let map' = strsToLevel (lines map)
  return map'

{-|
  Read a String representation of a map and convert
  it to the internal Level structure.

  Key:

   * '#' = Wall

   * '_' = Goal

   * 'O' = Block

   * '@' = Player starting location
-}