diff options
Diffstat (limited to 'kasus.py')
-rw-r--r-- | kasus.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/kasus.py b/kasus.py new file mode 100644 index 0000000..ba286eb --- /dev/null +++ b/kasus.py @@ -0,0 +1,33 @@ +from colorama import Fore, Back, Style + +import query +import solver + +total = 0 +correct = 0 + +while True: + case, article, number, adjective, noun = query.get() + + parameters = f"{Fore.MAGENTA}{case}, {Fore.BLUE}{article}, {Fore.YELLOW}{number}{Style.RESET_ALL}" + queryString = f"{noun}, {adjective}" + + total += 1 + print(f"{Style.BRIGHT}--- Übung {total} ---{Style.NORMAL}") + print(parameters) + print(queryString) + print() + + response = input("> ") + + solution = solver.solve(case, article, number, adjective, noun) + print(f"{Style.BRIGHT}", end="") + + if response == solution: + correct += 1 + print(f"{Fore.GREEN}Richtig ({correct}/{total})") + else: + print(f"{Fore.RED}Falsch ({correct}/{total}):{Style.RESET_ALL} {solution}") + + print(f"{Style.RESET_ALL}") + |