From e611a2ccf16d690a80334f9ba231eab6bb6b6f27 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 10 Dec 2022 15:05:21 -0500 Subject: Spaces in answer attempts are now ignored fixes #11 --- lingo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lingo.cpp b/lingo.cpp index 3391c30..8f972e3 100644 --- a/lingo.cpp +++ b/lingo.cpp @@ -311,6 +311,14 @@ public: { canonical_attempt.erase(canonical_attempt.find("||"), 2); } + while (canonical_attempt.find(" ") != std::string::npos) + { + canonical_attempt.erase(canonical_attempt.find(" "), 1); + } + while (canonical_answer.find(" ") != std::string::npos) + { + canonical_answer.erase(canonical_answer.find(" "), 1); + } std::cout << "\"" << canonical_attempt << "\"" << std::endl; if (canonical_attempt == canonical_answer) -- cgit 1.4.1