From 1f30b4ad59c3eff29e030ab97bd28a89fef18081 Mon Sep 17 00:00:00 2001 From: Munseer-am Date: Tue, 15 Nov 2022 07:11:37 +0530 Subject: [PATCH 1/2] Fixed Errors --- tutorial.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tutorial.py b/tutorial.py index dd5a8a9..5dad3a5 100644 --- a/tutorial.py +++ b/tutorial.py @@ -43,7 +43,7 @@ def wpm_test(stdscr): display_text(stdscr, target_text, current_text, wpm) stdscr.refresh() - if "".join(current_text) == target_text: + if len("".join(current_text)) == len(target_text): stdscr.nodelay(False) break @@ -52,9 +52,6 @@ def wpm_test(stdscr): except: continue - if ord(key) == 27: - break - if key in ("KEY_BACKSPACE", '\b', "\x7f"): if len(current_text) > 0: current_text.pop() @@ -73,7 +70,10 @@ def main(stdscr): stdscr.addstr(2, 0, "You completed the text! Press any key to continue...") key = stdscr.getkey() - if ord(key) == 27: + try: + if ord(key) == 27: + break + except TypeError: break wrapper(main) From c5d72e30051def9ce29b126bbfa3c89ceee68066 Mon Sep 17 00:00:00 2001 From: Munseer-am Date: Tue, 15 Nov 2022 07:19:46 +0530 Subject: [PATCH 2/2] Completed last sentence --- text.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text.txt b/text.txt index 279f658..03a79ac 100644 --- a/text.txt +++ b/text.txt @@ -2,4 +2,4 @@ Hello world my name is Tim and I am the best at making tutorials! This is another test block of text for this project! Subscribe to Tech With Tim on YouTube. Okay this is just another test to make sure the app is working okay! -The quick brown fox jumped over the rest of the sentence that I forget. \ No newline at end of file +The quick brown fox jumps over the lazy dog