From 6e012f7a3fd8b1ad5b1838bb285282a320ea15e8 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 17 Jan 2024 18:21:56 -0500 Subject: Generate steady data --- generator/generator.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'generator/generator.cpp') 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() { } } + // Color is (for The Steady) + { + std::list lines(readFile(datadirPath_ / "steady.txt")); + + hatkirby::progress ppgs("Generating The Steady puzzles...", lines.size()); + for (const std::string& line : lines) { + ppgs.update(); + + auto parts = hatkirby::split>(line, ","); + size_t word_id = LookupOrCreateWord(parts[0]); + size_t color_id = LookupOrCreateWord(parts[1]); + const Word& color_word = words_[color_id]; + const Word& word_word = words_[word_id]; + Form& word_form = forms_[word_word.base_form_id]; + word_form.puzzles[kColorIs].insert(color_word.base_form_id); + } + } + FindComboPuzzles("Generating purple middle red middle combo puzzles...", kPurpleMiddle, kRedMiddle); FindComboPuzzles("Generating purple top purple top combo puzzles...", -- cgit 1.4.1