summary refs log tree commit diff stats
path: root/generator/generator.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-01-17 18:21:56 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-01-17 18:21:56 -0500
commit6e012f7a3fd8b1ad5b1838bb285282a320ea15e8 (patch)
treea58375ff159147b996a4d3fadac473cd0c3eaf65 /generator/generator.cpp
parent3f20bb2f3772d3271d49d979e082b3f043a4b22e (diff)
downloadlingo-randomizer-6e012f7a3fd8b1ad5b1838bb285282a320ea15e8.tar.gz
lingo-randomizer-6e012f7a3fd8b1ad5b1838bb285282a320ea15e8.tar.bz2
lingo-randomizer-6e012f7a3fd8b1ad5b1838bb285282a320ea15e8.zip
Generate steady data
Diffstat (limited to 'generator/generator.cpp')
-rw-r--r--generator/generator.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/generator/generator.cpp b/generator/generator.cpp index b13dea2..7263591 100644 --- a/generator/generator.cpp +++ b/generator/generator.cpp
@@ -901,6 +901,24 @@ void generator::run() {
901 } 901 }
902 } 902 }
903 903
904 // Color is (for The Steady)
905 {
906 std::list<std::string> lines(readFile(datadirPath_ / "steady.txt"));
907
908 hatkirby::progress ppgs("Generating The Steady puzzles...", lines.size());
909 for (const std::string& line : lines) {
910 ppgs.update();
911
912 auto parts = hatkirby::split<std::vector<std::string>>(line, ",");
913 size_t word_id = LookupOrCreateWord(parts[0]);
914 size_t color_id = LookupOrCreateWord(parts[1]);
915 const Word& color_word = words_[color_id];
916 const Word& word_word = words_[word_id];
917 Form& word_form = forms_[word_word.base_form_id];
918 word_form.puzzles[kColorIs].insert(color_word.base_form_id);
919 }
920 }
921
904 FindComboPuzzles("Generating purple middle red middle combo puzzles...", 922 FindComboPuzzles("Generating purple middle red middle combo puzzles...",
905 kPurpleMiddle, kRedMiddle); 923 kPurpleMiddle, kRedMiddle);
906 FindComboPuzzles("Generating purple top purple top combo puzzles...", 924 FindComboPuzzles("Generating purple top purple top combo puzzles...",