From 2b0109468c2f846c8b682da81b8fa9567874e3bb Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Wed, 27 Jan 2021 20:20:41 -0500 Subject: [PATCH] [+] Implement regular math expressions --- .../AlarmActivationViewController.swift | 5 ++ ProjectClock/Base.lproj/Main.storyboard | 8 +-- ProjectClock/MathExpressions.swift | 55 ++++++++----------- ProjectClock/Models.swift | 5 +- 4 files changed, 36 insertions(+), 37 deletions(-) diff --git a/ProjectClock/AlarmActivationViewController.swift b/ProjectClock/AlarmActivationViewController.swift index 9b543f5..1028055 100644 --- a/ProjectClock/AlarmActivationViewController.swift +++ b/ProjectClock/AlarmActivationViewController.swift @@ -102,6 +102,11 @@ class AlarmActivationViewController: EndEditingOnReturn // Initialize alarm switch wvm { + case "Math 1", "Math 2", "Math 3": + let q = MathExpProblem(size: Int(wvm[5...5])!) + puzzleQuestionLabel.text = "Solve: \(q.prob.replacingOccurrences(of: "**", with: "^"))" + puzzleAnswers = [q.ans] + puzzleView.show() case "Factor": initFactorProblem() puzzleView.show() diff --git a/ProjectClock/Base.lproj/Main.storyboard b/ProjectClock/Base.lproj/Main.storyboard index 699b339..42d14d2 100644 --- a/ProjectClock/Base.lproj/Main.storyboard +++ b/ProjectClock/Base.lproj/Main.storyboard @@ -677,10 +677,10 @@ -