Fade in and fade out

This commit is contained in:
2026-05-03 20:24:24 -04:00
parent 24fed2fa7a
commit fbe46b8215
11 changed files with 178 additions and 22 deletions

17
main.py
View File

@@ -66,6 +66,17 @@ def generate_problem_message():
return problem
def main():
problem_solved = False
while not problem_solved:
problem = generate_problem()
problem["steps"] = generate_steps(problem);
problem_solved = check_solution(problem["steps"][-1]["after"], problem["solution"])
if not problem_solved:
print(f"issue with problem: {problem}")
return pretty_print_steps(problem["steps"])
def check_solution(got, solution):
values = set([sympify(r.split("=")[1].strip()) for r in got.split(",")])
if is_iterable(solution) and not isinstance(solution, str):
@@ -97,4 +108,8 @@ def is_iterable(obj):
iter(obj)
return True
except TypeError:
return False
return False
#Starts the program
if __name__ == "__main__":
main()