Обновить u8/program.py
This commit is contained in:
parent
da35148606
commit
8cc69c964b
@ -13,3 +13,23 @@ answer_count = 0
|
|||||||
def bad_database():
|
def bad_database():
|
||||||
print("Chybna databaza")
|
print("Chybna databaza")
|
||||||
exit()
|
exit()
|
||||||
|
def load():
|
||||||
|
global pos, question_count, answer_count
|
||||||
|
|
||||||
|
if pos >= len(rows):
|
||||||
|
bad_database()
|
||||||
|
|
||||||
|
text = rows[pos]
|
||||||
|
pos += 1
|
||||||
|
|
||||||
|
if text == "":
|
||||||
|
bad_database()
|
||||||
|
|
||||||
|
if "?" == text[-1]:
|
||||||
|
question_count = question_count + 1
|
||||||
|
left = load()
|
||||||
|
right = load()
|
||||||
|
return (text, left, right)
|
||||||
|
else:
|
||||||
|
answer_count += 1
|
||||||
|
return (text,)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user