diff --git a/u8/program.py b/u8/program.py index a4487a9..640656d 100644 --- a/u8/program.py +++ b/u8/program.py @@ -27,6 +27,31 @@ def main(): root = create_tree(lines, index, counts) + print(f"Pocet otazok: {counts[0]}") + print(f"Pocet odpovedi: {counts[1]}") + print("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.") + print() + current = root + + while current.text.endswith("?"): + print(current.text) + try: + answer = input() + except EOFError: + print("Koniec vstupu") + return + if answer == "a": + current = current.yes + elif answer == "n": + current = current.no + else: + print("Nerozumiem") + return + + print(current.text) + print("Koniec") + + if __name__ == "__main__": main()