diff --git a/smassh/src/stats_tracker.py b/smassh/src/stats_tracker.py index 4d7cad20..f1207908 100644 --- a/smassh/src/stats_tracker.py +++ b/smassh/src/stats_tracker.py @@ -108,7 +108,13 @@ def raw_wpm(self) -> int: @property def accuracy(self) -> int: - accuracy = (self.correct / (self.correct + self.incorrect)) * 100 + total_typed = self.correct + self.incorrect + + if total_typed == 0: + return 0 + + accuracy = (self.correct / total_typed) * 100 + return round(accuracy) @property