from vector2 import * class Gui: def __init__(self, width: int, height: int) -> None: self.__width = width self.__height = height # self.__data = None self.clear() def draw(self, x: int, y: int, symbol: str): self.__data[x + y * self.__width] = symbol def show(self): for y in range(self.__height): for x in range(self.__width): print(self.__data[x + y * self.__width], end="") print("") def clear(self): self.__data = [" " for _ in range(self.__width * self.__height)] def input_direction(self) -> Vector2: match input("pohyb: "): case "2": return Vector2(0, 1) case "4": return Vector2(-1, 0) case "6": return Vector2(1, 0) case "8": return Vector2(0, -1) case _: return Vector2(0, 0)