From 8607aacc15e9a2d304a18b1d311ba6eabc9b5236 Mon Sep 17 00:00:00 2001 From: kris Date: Thu, 3 Dec 2020 10:49:40 +0000 Subject: [PATCH] Fix rewind() with bit_count > 1 --- wozardry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wozardry.py b/wozardry.py index 44c524d..de0c6de 100755 --- a/wozardry.py +++ b/wozardry.py @@ -170,8 +170,8 @@ class Track: n += b << bit_index yield n - def rewind(self, bit_count): - self.bit_index -= 1 + def rewind(self, bit_count=1): + self.bit_index -= bit_count if self.bit_index < 0: self.bit_index = self.bit_count - 1 self.revolutions -= 1