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/PuzzlesetEasy.cpp | 379 +++++++++++++++++++++++++++++++++ 1 file changed, 379 insertions(+) create mode 100644 ext/wittle_generator/PuzzlesetEasy.cpp (limited to 'ext/wittle_generator/PuzzlesetEasy.cpp') diff --git a/ext/wittle_generator/PuzzlesetEasy.cpp b/ext/wittle_generator/PuzzlesetEasy.cpp new file mode 100644 index 0000000..4e2f84f --- /dev/null +++ b/ext/wittle_generator/PuzzlesetEasy.cpp @@ -0,0 +1,379 @@ +#include "PuzzlesetEasy.h" + +#include "Generate.h" + +const std::vector>& GetEasyPuzzles() { + static std::vector> generator_fns{ + [](Generate& generator) { + generator.setSymbol(Decoration::Start, 2 * 2, 2 * 2); + generator.setSymbol(Decoration::Exit, 4 * 2, 0); + generator.generate( + 4, 4, {{{Decoration::Dot_Intersection, 25}, {Decoration::Gap, 2}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Start, 0, 4 * 2); + generator.generate(4, 4, + {{{Decoration::Stone | Decoration::Color::Black, 7}, + {Decoration::Stone | Decoration::Color::White, 5}, + {Decoration::Exit, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setSymmetry(Panel::Rotational); + generator.generate(6, 6, {{{Decoration::Gap, 15}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setSymmetry(Panel::Vertical); + generator.generate(5, 8, {{{Decoration::Gap, 15}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setSymmetry(Panel::Horizontal); + generator.generate(5, 5, {{{Decoration::Dot, 7}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setSymmetry(Panel::Rotational); + generator.generate(5, 5, {{{Decoration::Dot, 6}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setSymmetry(Panel::Rotational); + generator.generate(5, 5, + {{{Decoration::Dot | Decoration::Color::Blue, 1}, + {Decoration::Dot | Decoration::Color::Yellow, 2}, + {Decoration::Dot, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, {{{Decoration::Poly | Decoration::Color::Yellow, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::FullGaps); + generator.setFlag(Generate::StartEdgeOnly); + generator.generate(5, 5, + {{{Decoration::Gap, 16}, + {Decoration::Dot, 10}, + {Decoration::Exit, 1}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(3, 3, + {{{Decoration::Eraser | Decoration::Color::Green, 1}, + {Decoration::Dot, 8}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Stone | Decoration::Color::White, 8}, + {Decoration::Stone | Decoration::Color::Black, 4}, + {Decoration::Eraser | Decoration::Color::Green, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Stone | Decoration::Color::Red, 4}, + {Decoration::Stone | Decoration::Color::White, 4}, + {Decoration::Stone | Decoration::Color::Black, 3}, + {Decoration::Eraser | Decoration::Color::Green, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::RequireCombineShapes); + generator.generate(4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 1}, + {Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 1}, + {Decoration::Gap, 5}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 3, 3, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Eraser | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::FullGaps); + generator.generate(4, 4, + {{{Decoration::Gap, 8}, + {Decoration::Dot_Intersection, 10}, + {Decoration::Exit, 1}, + {Decoration::Start, 3}}}); + }, + [](Generate& generator) { + generator.generate(5, 5, + {{{Decoration::Exit, 1}, + {Decoration::Stone | Decoration::Color::Black, 11}, + {Decoration::Stone | Decoration::Color::White, 8}, + {Decoration::Start, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(4, 4, + {{{Decoration::Star | Decoration::Color::Green, 6}, + {Decoration::Star | Decoration::Color::Orange, 5}, + {Decoration::Eraser | Decoration::Orange, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(4, 4, + {{{Decoration::Star | Decoration::Color::Orange, 6}, + {Decoration::Star | Decoration::Color::Magenta, 5}, + {Decoration::Star | Decoration::Color::Green, 4}, + {Decoration::Eraser | Decoration::Magenta, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(4, 4, + {{{Decoration::Star | Decoration::Color::Magenta, 6}, + {Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Eraser | Decoration::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(4, 4, + {{{Decoration::Star | Decoration::Color::Magenta, 5}, + {Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Eraser | Decoration::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate(4, 4, + {{{Decoration::Star | Decoration::Color::Orange, 4}, + {Decoration::Gap, 10}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(5, 5, + {{{Decoration::Star | Decoration::Color::Orange, 10}, + {Decoration::Gap, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate(4, 4, + {{{Decoration::Star | Decoration::Color::Orange, 4}, + {Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Gap, 8}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate(4, 4, + {{{Decoration::Star | Decoration::Color::Orange, 4}, + {Decoration::Star | Decoration::Color::Magenta, 2}, + {Decoration::Star | Decoration::Color::Green, 2}, + {Decoration::Gap, 8}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 3, + {{{Decoration::Star | Decoration::Color::Orange, 6}, + {Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Star | Decoration::Color::Green, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.setFlag(Generate::FullGaps); + generator.generate(4, 4, + {{{Decoration::Star | Decoration::Color::Magenta, 6}, + {Decoration::Dot_Intersection, 6}, + {Decoration::Gap, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Stone | Decoration::Color::Black, 4}, + {Decoration::Stone | Decoration::Color::White, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 3, 3, + {{{Decoration::Star | Decoration::Color::Black, 1}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::White, 2}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 2}, + {Decoration::Stone | Decoration::Color::Purple, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Orange, 2}, + {Decoration::Star | Decoration::Color::Magenta, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 5, + {{{Decoration::Stone | Decoration::Color::White, 8}, + {Decoration::Stone | Decoration::Color::Black, 8}, + {Decoration::Eraser | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate(4, 5, + {{{Decoration::Poly | Decoration::Color::Orange, 2}, + {Decoration::Stone | Decoration::Color::White, 4}, + {Decoration::Stone | Decoration::Color::Black, 4}, + {Decoration::Gap, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Dot_Intersection, 25}, + {Decoration::Poly | Decoration::Color::Yellow, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Dot_Intersection, 25}, + {Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 2}, + {Decoration::Eraser | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setSymmetry(Panel::Rotational); + generator.generate( + 5, 5, + {{{Decoration::Stone | Decoration::Color::Black, 6}, + {Decoration::Stone | Decoration::Color::White, 6}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setSymmetry(Panel::Rotational); + generator.generate(5, 5, + {{{Decoration::Stone | Decoration::Color::Black, 5}, + {Decoration::Stone | Decoration::Color::White, 5}, + {Decoration::Dot, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::SplitShapes); + generator.generate(4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Gap, 8}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::BigShapes); + generator.generate(5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Gap, 12}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::DisconnectShapes); + generator.generate( + 3, 3, {{{Decoration::Poly | Decoration::Color::Yellow, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::DisconnectShapes); + generator.setFlag(Generate::BigShapes); + generator.generate( + 4, 4, {{{Decoration::Poly | Decoration::Color::Yellow, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::RequireCombineShapes); + generator.setFlag(Generate::DisableCancelShapes); + generator.generate(3, 3, + {{{Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::RequireCombineShapes); + generator.setFlag(Generate::DisableCancelShapes); + generator.generate(4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::BigShapes); + generator.setFlag(Generate::DisableCancelShapes); + generator.generate(4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::RequireCancelShapes); + generator.generate(4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, {{{Decoration::Triangle | Decoration::Color::Orange, 6}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.setFlag(Generate::LongPath); + generator.generate( + 5, 4, + {{{Decoration::Star | Decoration::Color::Magenta, 6}, + {Decoration::Stone | Decoration::Color::Orange, 4}, + {Decoration::Stone | Decoration::Color::Green, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Dot, 6}, + {Decoration::Stone | Decoration::Color::Black, 3}, + {Decoration::Stone | Decoration::Color::White, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Dot, 4}, + {Decoration::Stone | Decoration::Color::Black, 3}, + {Decoration::Stone | Decoration::Color::White, 2}, + {Decoration::Poly | Decoration::Color::Yellow, 1}}}); + }, + [](Generate& generator) { + generator.setSymmetry(Panel::Rotational); + generator.generate(5, 5, + {{{Decoration::Dot | Decoration::Color::Blue, 2}, + {Decoration::Dot | Decoration::Color::Yellow, 2}, + {Decoration::Dot, 4}, + {Decoration::Start, 2}, + {Decoration::Exit, 1}}}); + }, + }; + + return generator_fns; +} -- cgit 1.4.1