From f3bc5a95b553f41de794db7d3351b79ffcd64efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 9 Mar 2021 12:01:18 +0100 Subject: [PATCH] =?UTF-8?q?generate-alt-random:=20DECGRI:=20don=E2=80=99t?= =?UTF-8?q?=20emit=20zero-length=20repeat=20sequences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/generate-alt-random-writes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/generate-alt-random-writes.py b/scripts/generate-alt-random-writes.py index 0923501b..54a34c01 100755 --- a/scripts/generate-alt-random-writes.py +++ b/scripts/generate-alt-random-writes.py @@ -208,9 +208,9 @@ def main(): else: pix_left = six_width while pix_left > 0: - pix_count = random.randrange(pix_left + 1) - out.write(f'!{pix_count}{random.choice(sixels)}') - pix_left -= pix_count + repeat_count = random.randrange(1, pix_left + 1) + out.write(f'!{repeat_count}{random.choice(sixels)}') + pix_left -= repeat_count # Next line if band + 1 < band_count: