1

I am trying to create a new instance of Grid, populate that grid with the entities and return that grid.

what I've done as code:

class MapLoader:
    """ds"""
    def load(self, filename:str)->Grid:
        with open(filename) as map_file:
            contents = map_file.readlines()

        result = {}
        for y, line in enumerate(contents):
            for x, char in enumerate(line.strip("\n")):
                if char != " ":
                    result[(x, y)] = char

        return result, len(contents)

This giving me error ,as I may thinking wrongly: enter image description here

It would be great If you can help me regards this issue.

Thanks

Zerone
  • 127
  • 1
  • 12

0 Answers0