From 0822404cf75fb6ad04faf55861faaf8330effa59 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 14 Jan 2025 19:35:34 -0500 Subject: Split puzzle generators into separate files --- ext/wittle_generator/Test.cpp | 47 +++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 13 deletions(-) (limited to 'ext/wittle_generator/Test.cpp') diff --git a/ext/wittle_generator/Test.cpp b/ext/wittle_generator/Test.cpp index 8273da8..a1faba9 100644 --- a/ext/wittle_generator/Test.cpp +++ b/ext/wittle_generator/Test.cpp @@ -1,19 +1,40 @@ +#include +#include +#include +#include + #include "Generate.h" +#include "PuzzlesetEasy.h" +#include "PuzzlesetHard.h" +#include "PuzzlesetMedium.h" int main(int, char**) { - Generate generator; - // generator.setFlag(Generate::RegularStartEnd); - /*generator.generate(4 * 2 + 1, 4 * 2 + 1, - {{{Decoration::Triangle | Decoration::Orange, 6}}});*/ - // generator.setSymmetry(Panel::Vertical); - generator.setSymbol(Decoration::Exit, 0, 0); - generator.setSymbol(Decoration::Exit, 7 * 2, 0); - generator.setSymbol(Decoration::Exit, 7 * 2, 7 * 2); - generator.generate(7 * 2 + 1, 7 * 2 + 1, - {{{Decoration::Stone | Decoration::Color::White, 10}, - {Decoration::Stone | Decoration::Color::Black, 10}, - {Decoration::Dot, 10}, - {Decoration::Start, 2}}}); + const std::vector>& easy_gens = + GetEasyPuzzles(); + for (size_t i = 0; i < easy_gens.size(); i++) { + std::cout << "Generate EASY choice " << std::dec << i << ":" << std::endl; + + Generate generator; + easy_gens.at(i)(generator); + } + + const std::vector>& medium_gens = + GetMediumPuzzles(); + for (size_t i = 0; i < medium_gens.size(); i++) { + std::cout << "Generate MEDIUM choice " << std::dec << i << ":" << std::endl; + + Generate generator; + medium_gens.at(i)(generator); + } + + const std::vector>& hard_gens = + GetHardPuzzles(); + for (size_t i = 0; i < hard_gens.size(); i++) { + std::cout << "Generate HARD choice " << std::dec << i << ":" << std::endl; + + Generate generator; + hard_gens.at(i)(generator); + } return 0; } -- cgit 1.4.1