diff --git a/u8/program.py b/u8/program.py index e5d5cff..8ad37d1 100644 --- a/u8/program.py +++ b/u8/program.py @@ -45,4 +45,28 @@ answers = rows[pos + 1:] print("Pocet otazok:", question_count) print("Pocet odpovedi:", answer_count) print("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.") +current = tree +print(current[0]) + +step = 0 + +while len(current) > 1: + if step == len(answers): + print("Koniec vstupu") + exit() + + choice = answers[step] + step += 1 + + if choice == "a": + current = current[1] + elif choice == "n": + current = current[2] + else: + print("Nerozumiem") + exit() + + print(current[0]) + +print("Koniec")