From ed3bb658245b3e4d14dfee44234c63e802a2296d Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Thu, 10 Nov 2022 22:24:38 -0500 Subject: [PATCH] [F] Fix random count being negative when screen is too small --- hyfetch/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hyfetch/main.py b/hyfetch/main.py index c7c6edd2..68963a70 100755 --- a/hyfetch/main.py +++ b/hyfetch/main.py @@ -291,7 +291,7 @@ def create_config() -> Config: while len(pis) < len(slots): pis += pis perm = {p[:len(slots)] for p in permutations(pis)} - random_count = ascii_per_row * ascii_rows - len(arrangements) + random_count = max(0, ascii_per_row * ascii_rows - len(arrangements)) if random_count > len(perm): choices = perm else: