diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-12-10 15:05:21 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-12-10 15:05:33 -0500 |
commit | e611a2ccf16d690a80334f9ba231eab6bb6b6f27 (patch) | |
tree | 1e84a064025ff5792c88710bc4bcafbbd6288ca3 /lingo.cpp | |
parent | 9b77c375056b41f3ec01798ae3a567fc0075a14b (diff) | |
download | lingo-e611a2ccf16d690a80334f9ba231eab6bb6b6f27.tar.gz lingo-e611a2ccf16d690a80334f9ba231eab6bb6b6f27.tar.bz2 lingo-e611a2ccf16d690a80334f9ba231eab6bb6b6f27.zip |
Spaces in answer attempts are now ignored
fixes #11
Diffstat (limited to 'lingo.cpp')
-rw-r--r-- | lingo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lingo.cpp b/lingo.cpp index 3391c30..8f972e3 100644 --- a/lingo.cpp +++ b/lingo.cpp | |||
@@ -311,6 +311,14 @@ public: | |||
311 | { | 311 | { |
312 | canonical_attempt.erase(canonical_attempt.find("||"), 2); | 312 | canonical_attempt.erase(canonical_attempt.find("||"), 2); |
313 | } | 313 | } |
314 | while (canonical_attempt.find(" ") != std::string::npos) | ||
315 | { | ||
316 | canonical_attempt.erase(canonical_attempt.find(" "), 1); | ||
317 | } | ||
318 | while (canonical_answer.find(" ") != std::string::npos) | ||
319 | { | ||
320 | canonical_answer.erase(canonical_answer.find(" "), 1); | ||
321 | } | ||
314 | 322 | ||
315 | std::cout << "\"" << canonical_attempt << "\"" << std::endl; | 323 | std::cout << "\"" << canonical_attempt << "\"" << std::endl; |
316 | if (canonical_attempt == canonical_answer) | 324 | if (canonical_attempt == canonical_answer) |