diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-01-17 18:21:56 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-01-17 18:21:56 -0500 |
commit | 6e012f7a3fd8b1ad5b1838bb285282a320ea15e8 (patch) | |
tree | a58375ff159147b996a4d3fadac473cd0c3eaf65 /generator | |
parent | 3f20bb2f3772d3271d49d979e082b3f043a4b22e (diff) | |
download | lingo-randomizer-6e012f7a3fd8b1ad5b1838bb285282a320ea15e8.tar.gz lingo-randomizer-6e012f7a3fd8b1ad5b1838bb285282a320ea15e8.tar.bz2 lingo-randomizer-6e012f7a3fd8b1ad5b1838bb285282a320ea15e8.zip |
Generate steady data
Diffstat (limited to 'generator')
-rw-r--r-- | generator/generator.cpp | 18 | ||||
-rw-r--r-- | generator/generator.h | 1 |
2 files changed, 19 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...", |
diff --git a/generator/generator.h b/generator/generator.h index cf304ea..21774d7 100644 --- a/generator/generator.h +++ b/generator/generator.h | |||
@@ -27,6 +27,7 @@ enum PuzzleType { | |||
27 | kBlueBottom = 13, | 27 | kBlueBottom = 13, |
28 | kPurpleTop = 14, | 28 | kPurpleTop = 14, |
29 | kPurpleMiddle = 15, | 29 | kPurpleMiddle = 15, |
30 | kColorIs = 16, | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | class generator { | 33 | class generator { |