diff --git a/tools/grid.py b/tools/grid.py index 50190da..c9e3125 100644 --- a/tools/grid.py +++ b/tools/grid.py @@ -377,10 +377,10 @@ class Grid: ) @classmethod - def from_str(cls, grid_string: str, true_char: str = '#', default: Any = False) -> 'Grid': + def from_str(cls, grid_string: str, true_char: str = '#', true_value: Any = True, default: Any = False) -> 'Grid': ret = cls(default=default) for y, line in enumerate(grid_string.split("/")): for x, c in enumerate(line): - ret.set(Coordinate(x, y), c == true_char) + ret.set(Coordinate(x, y), true_value if c == true_char else default) return ret