diff options
Diffstat (limited to 'robots/utils.py')
-rw-r--r-- | robots/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/robots/utils.py b/robots/utils.py index 5793a00..9abb08c 100644 --- a/robots/utils.py +++ b/robots/utils.py @@ -23,6 +23,14 @@ def immutable(value): pass return value +def read_map(f): + lines = [line.rstrip('\n') for line in f] + width = max(len(line) for line in lines) + return [ + list(line.ljust(width, City.NORMAL)) + for line in lines + ] + def add_spawns(map_, n_spawns, city=None): available = [] for x, y, cell in iter_board(map_): |