summary refs log tree commit diff stats
path: root/generator
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-12-13 23:07:34 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2023-12-13 23:07:34 -0500
commit75bb79aac84c29ad4c9c30896e36200807435e3b (patch)
tree73a30c722d41e8e342d7403daaf926f0961759b4 /generator
parent35f3bd5342fb1096ab5a636af9d18f2af9d9ee11 (diff)
downloadlingo-randomizer-75bb79aac84c29ad4c9c30896e36200807435e3b.tar.gz
lingo-randomizer-75bb79aac84c29ad4c9c30896e36200807435e3b.tar.bz2
lingo-randomizer-75bb79aac84c29ad4c9c30896e36200807435e3b.zip
Fixed orange addition
Diffstat (limited to 'generator')
-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()) {