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 ++++++++++++++++++ generator/generator.h | 1 + 2 files changed, 19 insertions(+) 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...", 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 { kBlueBottom = 13, kPurpleTop = 14, kPurpleMiddle = 15, + kColorIs = 16, }; class generator { -- cgit 1.4.1