blob: 911cb5d7de6e2c704416f40a7ab20ff6a438c321 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
from colorama import Fore, Back, Style
import readline
import solver
total = 0
correct = 0
while True:
query, solution = solver.get()
parameters = f"{Fore.MAGENTA}{query.case}, {Fore.BLUE}{query.article}, {Fore.YELLOW}{query.cardinality}{Style.RESET_ALL}"
queryString = f"{query.noun['nom-sin']}, {query.adjective}"
total += 1
print(f"{Style.BRIGHT}--- Übung {total} ---{Style.NORMAL}")
print(parameters)
print(queryString)
print()
response = input("> ")
print(f"{Style.BRIGHT}", end="")
if solution.evaluate(response):
correct += 1
print(f"{Fore.GREEN}Richtig ({correct}/{total})")
else:
print(f"{Fore.RED}Falsch ({correct}/{total}):{Style.RESET_ALL} {solution.full}, {solution.noun}")
print(f"{Style.RESET_ALL}")
|