summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-01-04 23:03:42 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-01-04 23:03:42 -0500
commit011b91751445587308c558d860b8f8378f58977f (patch)
treeb0f55480f3040d9f8dd5acc54199685da22fa16a
parent77220e6e19d367227b4e69f2994ed90e13f33be3 (diff)
parent75bb79aac84c29ad4c9c30896e36200807435e3b (diff)
downloadlingo-randomizer-011b91751445587308c558d860b8f8378f58977f.tar.gz
lingo-randomizer-011b91751445587308c558d860b8f8378f58977f.tar.bz2
lingo-randomizer-011b91751445587308c558d860b8f8378f58977f.zip
Merge branch 'rewrite' of fourisland.com:/srv/git/lingo-randomizer into rewrite
-rw-r--r--generator/generator.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/generator/generator.cpp b/generator/generator.cpp index cd13051..435a63b 100644 --- a/generator/generator.cpp +++ b/generator/generator.cpp
@@ -864,10 +864,16 @@ void generator::run() {
864 wanderlust_.size()); 864 wanderlust_.size());
865 865
866 for (const auto& [cipher, form_id] : wanderlust_) { 866 for (const auto& [cipher, form_id] : wanderlust_) {
867 if (cipher < 100) {
868 continue;
869 }
867 for (const auto& [cipher2, form_id2] : wanderlust_) { 870 for (const auto& [cipher2, form_id2] : wanderlust_) {
868 if (cipher2 >= cipher) { 871 if (cipher2 >= cipher) {
869 break; 872 break;
870 } 873 }
874 if (cipher2 < 100) {
875 continue;
876 }
871 if (wanderlust_.count(cipher - cipher2)) { 877 if (wanderlust_.count(cipher - cipher2)) {
872 orange_addition.push_back(fmt::format( 878 orange_addition.push_back(fmt::format(
873 "[{},{},{}]", form_id2, wanderlust_[cipher - cipher2], form_id)); 879 "[{},{},{}]", form_id2, wanderlust_[cipher - cipher2], form_id));
@@ -1044,6 +1050,7 @@ size_t generator::LookupOrCreateForm(const std::string& word) {
1044 })) { 1050 })) {
1045 ciphered = 0; 1051 ciphered = 0;
1046 std::string to_cipher = word; 1052 std::string to_cipher = word;
1053 std::reverse(to_cipher.begin(), to_cipher.end());
1047 while (!to_cipher.empty()) { 1054 while (!to_cipher.empty()) {
1048 *ciphered *= 10; 1055 *ciphered *= 10;
1049 switch (to_cipher.back()) { 1056 switch (to_cipher.back()) {