[+] Encapsulate ascii dimensions
This commit is contained in:
@@ -21,3 +21,10 @@ def setup_logger(debug: bool):
|
||||
)
|
||||
|
||||
return logging.getLogger("a2")
|
||||
|
||||
|
||||
def get_ascii_dimensions(ascii_art: str) -> tuple[int, int]:
|
||||
"""Get the dimensions of an ASCII art."""
|
||||
height = ascii_art.count('\n')
|
||||
width = max(len(line.strip('\n')) for line in ascii_art.splitlines())
|
||||
return height, width
|
||||
|
||||
Reference in New Issue
Block a user