fix on counting incorrect words and white chars

This commit is contained in:
doman 2022-09-12 12:45:40 +02:00
parent 4d0c4129d8
commit 772c66e132
3 changed files with 9 additions and 4 deletions

View file

@ -53,8 +53,13 @@ class Buffer:
def _next_word(self):
self.current_word += 1
if self.current_char > 0:
self.stats.signal_valid() # space is a char after all
else:
self.stats.signal_invalid() # space after empty word
self.current_char = 0
self.stats.signal_valid() # space is a char after all
if self.current_word >= self.total_words:
self.stats.signal_stop(True)
@ -143,4 +148,4 @@ class Buffer:
if w != self.reference_words[i]:
count += 1
return count
return count + len(self.reference_words) - len(self.user_words)

View file

@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.3.1
current_version = 2.3.2
[wheel]
universal = 1

View file

@ -9,7 +9,7 @@ with open("requirements.txt", "r", encoding="utf-8") as fh:
setup(
name="fasttyper",
version="2.3.1",
version="2.3.2",
author="Piotr Domanski",
author_email="pi.domanski@gmail.com",
description="Minimalistic typing exercise",