summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lingo.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lingo.cpp b/lingo.cpp index 5f8a025..38c6483 100644 --- a/lingo.cpp +++ b/lingo.cpp
@@ -450,13 +450,14 @@ private:
450 msg_stream << NONE_EMOTE << std::endl; 450 msg_stream << NONE_EMOTE << std::endl;
451 } 451 }
452 } 452 }
453 std::string spaceless = solution.getText(); 453 auto byspace = hatkirby::split<std::list<std::string>>(solution.getText(), " ");
454 while (spaceless.find(" ") != std::string::npos) 454 std::list<std::string> lens;
455 for (const std::string& wordpart : byspace)
455 { 456 {
456 spaceless.erase(spaceless.find(" "), 1); 457 lens.push_back(std::to_string(wordpart.size()));
457 } 458 }
458 459
459 msg_stream << "(" << spaceless.size() << ")"; 460 msg_stream << "(" << hatkirby::implode(std::begin(lens), std::end(lens), " ") << ")";
460 461
461 std::string message_text = msg_stream.str(); 462 std::string message_text = msg_stream.str();
462 std::cout << message_text << std::endl << std::endl << solution.getText() << std::endl; 463 std::cout << message_text << std::endl << std::endl << solution.getText() << std::endl;