Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.py #63

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,27 @@ def main():
box = slots[box_idx]
q, a = box.pop(n // box_chance_mul[box_idx])
print(chr(27) + "[2J")
# print(box_idx, f, n)
print(q)

print("====================================")
print(" Flashcard ")
print("====================================")
print(f"Question: {q}")
print("-" * 4)
input("Answer: ")
o = input(f"The answer was: {a}\nWere you correct? (Y/n/exit): ")
print(f"The answer was: {a}")
print("=" * 5)
if not o or o[0].lower() == "y":

if not input("Were you correct? (Y/n/exit): ").strip()[:1].lower() in ["n", ""]:
box_idx = min(box_idx + 1, len(slots) - 1)
elif o[0].lower() == "n":
box_idx = max(box_idx - 1, 0)
else:
break
box_idx = max(box_idx - 1, 0)

slots[box_idx].append((q, a))

if len(cards) == len(slots[-1]):
print(f"You have memorised all {len(cards)} cards")
k = input("Exit? (N/y): ")
if o and o[0].lower() == "y":
if input("Exit? (N/y): ").strip()[:1].lower() == "y":
break

if __name__ == "__main__":
main()
main()