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/Base64.h | 2 + ext/wittle_generator/CMakeLists.txt | 2 +- ext/wittle_generator/Generate.cpp | 3 +- ext/wittle_generator/Panel.h | 1 + ext/wittle_generator/PuzzlesetEasy.cpp | 379 ++++++ ext/wittle_generator/PuzzlesetEasy.h | 11 + ext/wittle_generator/PuzzlesetHard.cpp | 933 ++++++++++++++ ext/wittle_generator/PuzzlesetHard.h | 11 + ext/wittle_generator/PuzzlesetMedium.cpp | 596 +++++++++ ext/wittle_generator/PuzzlesetMedium.h | 11 + ext/wittle_generator/Test.cpp | 47 +- ext/wittle_generator/wittle_generator.cpp | 1889 +---------------------------- 12 files changed, 1989 insertions(+), 1896 deletions(-) create mode 100644 ext/wittle_generator/PuzzlesetEasy.cpp create mode 100644 ext/wittle_generator/PuzzlesetEasy.h create mode 100644 ext/wittle_generator/PuzzlesetHard.cpp create mode 100644 ext/wittle_generator/PuzzlesetHard.h create mode 100644 ext/wittle_generator/PuzzlesetMedium.cpp create mode 100644 ext/wittle_generator/PuzzlesetMedium.h (limited to 'ext') diff --git a/ext/wittle_generator/Base64.h b/ext/wittle_generator/Base64.h index 2f30c1a..707a5a5 100644 --- a/ext/wittle_generator/Base64.h +++ b/ext/wittle_generator/Base64.h @@ -25,6 +25,8 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include + #include namespace macaron { diff --git a/ext/wittle_generator/CMakeLists.txt b/ext/wittle_generator/CMakeLists.txt index 561e78a..8a1928e 100644 --- a/ext/wittle_generator/CMakeLists.txt +++ b/ext/wittle_generator/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.1) project (wittle_generator) -add_executable(wittle_generator Generate.cpp Panel.cpp Random.cpp Serializer.cpp Test.cpp) +add_executable(wittle_generator Generate.cpp Panel.cpp Random.cpp Serializer.cpp Test.cpp PuzzlesetEasy.cpp PuzzlesetMedium.cpp PuzzlesetHard.cpp) set_property(TARGET wittle_generator PROPERTY CXX_STANDARD 17) set_property(TARGET wittle_generator PROPERTY CXX_STANDARD_REQUIRED ON) diff --git a/ext/wittle_generator/Generate.cpp b/ext/wittle_generator/Generate.cpp index b80b751..3d907cb 100644 --- a/ext/wittle_generator/Generate.cpp +++ b/ext/wittle_generator/Generate.cpp @@ -485,8 +485,7 @@ bool Generate::generate_maze(int id, int numStarts, int numExits) { }*/ void Generate::generate(int width, int height, PuzzleSymbols symbols) { - while (!generateInternal(width, height, symbols)) - ; + while (!generateInternal(width, height, symbols)); } // The primary generation function. id - id of the puzzle. symbols - a structure diff --git a/ext/wittle_generator/Panel.h b/ext/wittle_generator/Panel.h index 3bc23c9..3108af8 100644 --- a/ext/wittle_generator/Panel.h +++ b/ext/wittle_generator/Panel.h @@ -3,6 +3,7 @@ #include +#include #include #include 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; +} diff --git a/ext/wittle_generator/PuzzlesetEasy.h b/ext/wittle_generator/PuzzlesetEasy.h new file mode 100644 index 0000000..98c0bac --- /dev/null +++ b/ext/wittle_generator/PuzzlesetEasy.h @@ -0,0 +1,11 @@ +#ifndef PUZZLESET_EASY_H_65DB9C60 +#define PUZZLESET_EASY_H_65DB9C60 + +#include +#include + +class Generate; + +const std::vector>& GetEasyPuzzles(); + +#endif /* end of include guard: PUZZLESET_EASY_H_65DB9C60 */ diff --git a/ext/wittle_generator/PuzzlesetHard.cpp b/ext/wittle_generator/PuzzlesetHard.cpp new file mode 100644 index 0000000..c775d64 --- /dev/null +++ b/ext/wittle_generator/PuzzlesetHard.cpp @@ -0,0 +1,933 @@ +#include "PuzzlesetHard.h" + +#include "Generate.h" + +namespace { + +void MakeSecretSymmetryGrid(Generate& generator) { + for (int x : {0, 6, 8, 14}) { + for (int y : {0, 6, 8, 14}) { + generator.setSymbol(Decoration::Start, x, y); + } + } + for (int x : {0, 14}) { + for (int y : {2, 4, 10, 12}) { + generator.setSymbol(Decoration::Exit, x, y); + generator.setSymbol(Decoration::Exit, y, x); + } + } +} + +} // namespace + +const std::vector>& GetHardPuzzles() { + static std::vector> generator_fns{ + [](Generate& generator) { + generator.setFlag(Generate::StartEdgeOnly); + generator.setSymmetry(Panel::Rotational); + generator.generate( + 6, 6, + {{{Decoration::Triangle | Decoration::Color::Orange, 12}, + {Decoration::Start, 1}, + {Decoration::Exit, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::StartEdgeOnly); + generator.setFlag(Generate::WriteInvisible); + generator.setSymmetry(Panel::Rotational); + generator.generate(7, 7, + {{{Decoration::Dot | Decoration::Color::Blue, 4}, + {Decoration::Dot | Decoration::Color::Yellow, 4}, + {Decoration::Dot, 7}, + {Decoration::Start, 1}, + {Decoration::Exit, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::StartEdgeOnly); + generator.setFlag(Generate::WriteInvisible); + generator.setSymmetry(Panel::Rotational); + generator.generate(7, 7, + {{{Decoration::Stone | Decoration::Color::Black, 6}, + {Decoration::Stone | Decoration::Color::White, 6}, + {Decoration::Start, 1}, + {Decoration::Exit, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::StartEdgeOnly); + generator.setFlag(Generate::WriteInvisible); + generator.setSymmetry(Panel::Rotational); + generator.generate(7, 7, + {{{Decoration::Star | Decoration::Color::Orange, 6}, + {Decoration::Star | Decoration::Color::Green, 6}, + {Decoration::Start, 1}, + {Decoration::Exit, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::StartEdgeOnly); + generator.setFlag(Generate::WriteInvisible); + generator.setFlag(Generate::RequireCombineShapes); + generator.setSymmetry(Panel::Rotational); + generator.generate(5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Start, 1}, + {Decoration::Exit, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::StartEdgeOnly); + generator.setFlag(Generate::WriteInvisible); + generator.setSymmetry(Panel::Rotational); + generator.generate( + 7, 7, + {{{Decoration::Dot | Decoration::Color::Blue, 2}, + {Decoration::Dot | Decoration::Color::Yellow, 2}, + {Decoration::Dot, 8}, + {Decoration::Eraser | Decoration::Color::Purple, 1}, + {Decoration::Start, 1}, + {Decoration::Exit, 1}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Exit, 0, 0); + generator.setSymbol(Decoration::Exit, 0, 4 * 4); + generator.setSymbol(Decoration::Exit, 4 * 4, 0); + generator.setSymbol(Decoration::Exit, 4 * 4, 4 * 4); + generator.generate(8, 8, + {{{Decoration::Stone | Decoration::Color::White, 10}, + {Decoration::Stone | Decoration::Color::Black, 10}, + {Decoration::Dot_Intersection, 81}, + {Decoration::Start, 8}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 6, 6, + {{{Decoration::Dot_Intersection, 49}, + {Decoration::Poly | Decoration::Color::Orange, 1}, + {Decoration::Poly | Decoration::Color::Blue, 1}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Orange, + 1}, + {Decoration::Star | Decoration::Color::Orange, 4}, + {Decoration::Star | Decoration::Color::Blue, 3}, + {Decoration::Triangle | Decoration::Color::Orange, 2}, + {Decoration::Triangle | Decoration::Color::Blue, 1}, + {Decoration::Stone | Decoration::Color::Orange, 1}, + {Decoration::Stone | Decoration::Color::Blue, 2}, + {Decoration::Eraser | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setSymmetry(Panel::Rotational); + generator.generate( + 7, 7, {{{Decoration::Poly | Decoration::Color::Yellow, 5}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 1}, + {Decoration::Stone | Decoration::Color::Black, 5}, + {Decoration::Stone | Decoration::Color::White, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::BigShapes); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 2}, + {Decoration::Triangle | Decoration::Color::Orange, 3}, + {Decoration::Stone | Decoration::Color::Black, 3}, + {Decoration::Stone | Decoration::Color::White, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::StartEdgeOnly); + generator.setSymbol(Decoration::Exit, 4 * 2, 0); + generator.generate(5, 5, + {{{Decoration::Dot_Intersection, 36}, + {Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::BigShapes); + generator.setFlag(Generate::RequireCancelShapes); + generator.generate(5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 6, + {{{Decoration::Dot_Intersection, 42}, + {Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 1}, + {Decoration::Triangle | Decoration::Color::Orange, 3}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 1}, + {Decoration::Stone | Decoration::Color::Black, 4}, + {Decoration::Stone | Decoration::Color::White, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 2}, + {Decoration::Triangle | Decoration::Color::Orange, 5}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 1}, + {Decoration::Triangle | Decoration::Color::Orange, 3}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 2}, + {Decoration::Triangle | Decoration::Color::Orange, 3}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::DisconnectShapes); + generator.setFlag(Generate::BigShapes); + generator.setSymbol(Decoration::Start, 0, 5 * 2); + generator.setSymbol(Decoration::Exit, 0, 0); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 1}, + {Decoration::Triangle | Decoration::Color::Orange, 3}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::BigShapes); + generator.setSymbol(Decoration::Exit, 5 * 2, 0); + generator.generate(5, 5, + {{{Decoration::Dot_Intersection, 36}, + {Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 1}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::BigShapes); + generator.setSymbol(Decoration::Exit, 5 * 2, 0); + generator.generate(5, 5, + {{{Decoration::Dot_Intersection, 36}, + {Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 2}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Orange, 4}, + {Decoration::Triangle | Decoration::Color::Orange, 6}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Orange, 6}, + {Decoration::Triangle | Decoration::Color::Orange, 5}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Orange, 5}, + {Decoration::Triangle | Decoration::Color::Orange, 3}, + {Decoration::Stone | Decoration::Color::Orange, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate(5, 5, + {{{Decoration::Poly | Decoration::Color::Orange, 3}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 1}, + {Decoration::Star | Decoration::Color::Orange, 5}, + {Decoration::Star | Decoration::Color::Blue, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate(5, 5, + {{{Decoration::Poly | Decoration::Color::Orange, 3}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 2}, + {Decoration::Star | Decoration::Color::Orange, 5}, + {Decoration::Star | Decoration::Color::Blue, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Orange, 1}, + {Decoration::Poly | Decoration::Color::Magenta, 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Orange, + 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 2}, + {Decoration::Star | Decoration::Color::Orange, 3}, + {Decoration::Star | Decoration::Color::Blue, 3}, + {Decoration::Star | Decoration::Color::Magenta, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Magenta, 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 2}, + {Decoration::Star | Decoration::Color::Magenta, 3}, + {Decoration::Star | Decoration::Color::Blue, 3}, + {Decoration::Triangle | Decoration::Color::Magenta, 2}, + {Decoration::Triangle | Decoration::Color::Blue, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Orange, 1}, + {Decoration::Poly | Decoration::Color::Blue, 1}, + {Decoration::Poly | Decoration::Color::Green, 1}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 1}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Magenta, + 2}, + {Decoration::Star | Decoration::Color::Green, 2}, + {Decoration::Star | Decoration::Color::Magenta, 1}, + {Decoration::Star | Decoration::Color::Orange, 1}, + {Decoration::Star | Decoration::Color::Blue, 2}, + {Decoration::Triangle | Decoration::Color::Magenta, 2}, + {Decoration::Triangle | Decoration::Color::Orange, 1}, + {Decoration::Triangle | Decoration::Color::Green, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Orange, 4}, + {Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Triangle | Decoration::Color::Orange, 2}, + {Decoration::Triangle | Decoration::Color::Magenta, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Orange, 3}, + {Decoration::Star | Decoration::Color::Magenta, 3}, + {Decoration::Star | Decoration::Color::Green, 6}, + {Decoration::Triangle | Decoration::Color::Orange, 2}, + {Decoration::Triangle | Decoration::Color::Magenta, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Orange, 4}, + {Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Star | Decoration::Color::Green, 6}, + {Decoration::Triangle | Decoration::Color::Orange, 1}, + {Decoration::Triangle | Decoration::Color::Magenta, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Orange, 2}, + {Decoration::Star | Decoration::Color::Magenta, 2}, + {Decoration::Star | Decoration::Color::White, 2}, + {Decoration::Star | Decoration::Color::Green, 2}, + {Decoration::Star | Decoration::Color::Black, 2}, + {Decoration::Triangle | Decoration::Color::Orange, 1}, + {Decoration::Triangle | Decoration::Color::Magenta, 1}, + {Decoration::Triangle | Decoration::Color::White, 1}, + {Decoration::Triangle | Decoration::Color::Green, 1}, + {Decoration::Triangle | Decoration::Color::Black, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate(5, 5, + {{{Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Star | Decoration::Color::Orange, 6}, + {Decoration::Dot_Intersection, 36}}}); + }, + [](Generate& generator) { + generator.setGridSize(7, 7); + generator.setFlag(Generate::RequireCombineShapes); + generator.setSymmetry(Panel::ParallelV); + generator.setSymbol(Decoration::Start, 0, 14); + generator.setSymbol(Decoration::Start, 8, 14); + generator.setSymbol(Decoration::Exit, 6, 0); + generator.setSymbol(Decoration::Exit, 14, 0); + generator.generate( + 7, 7, {{{Decoration::Poly | Decoration::Color::Orange, 5}}}); + }, + [](Generate& generator) { + generator.setGridSize(7, 7); + generator.setFlag(Generate::RequireCombineShapes); + generator.setSymmetry(Panel::ParallelHFlip); + generator.setSymbol(Decoration::Start, 0, 14); + generator.setSymbol(Decoration::Start, 14, 6); + generator.setSymbol(Decoration::Exit, 0, 0); + generator.setSymbol(Decoration::Exit, 14, 8); + generator.generate( + 7, 7, {{{Decoration::Poly | Decoration::Color::Orange, 5}}}); + }, + [](Generate& generator) { + generator.setGridSize(7, 7); + generator.setFlag(Generate::RequireCombineShapes); + generator.setSymmetry(Panel::ParallelVFlip); + generator.setSymbol(Decoration::Start, 0, 14); + generator.setSymbol(Decoration::Start, 8, 0); + generator.setSymbol(Decoration::Exit, 6, 0); + generator.setSymbol(Decoration::Exit, 14, 14); + generator.generate( + 7, 7, {{{Decoration::Poly | Decoration::Color::Orange, 5}}}); + }, + [](Generate& generator) { + generator.setSymmetry(Panel::Symmetry::RotateLeft); + generator.setSymbol(Decoration::Start, 4, 4); + generator.setSymbol(Decoration::Start, 10, 4); + generator.setSymbol(Decoration::Start, 4, 10); + generator.setSymbol(Decoration::Start, 10, 10); + generator.setSymbol(Decoration::Exit, 4, 0); + generator.setSymbol(Decoration::Exit, 14, 4); + generator.setSymbol(Decoration::Exit, 0, 10); + generator.setSymbol(Decoration::Exit, 10, 14); + generator.generate( + 7, 7, + {{{Decoration::Triangle4 | Decoration::Color::Orange, 1}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::WriteInvisible); + generator.setFlag(Generate::StartEdgeOnly); + generator.setSymmetry(Panel::Symmetry::FlipXY); + generator.setSymbol(Decoration::Exit, 0, 8); + generator.setSymbol(Decoration::Exit, 8, 0); + generator.generate(7, 7, + {{{Decoration::Dot | Decoration::Color::Blue, 2}, + {Decoration::Dot | Decoration::Color::Yellow, 2}, + {Decoration::Dot, 8}, + {Decoration::Eraser | Decoration::Color::White, 1}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setSymmetry(Panel::Symmetry::FlipXY); + generator.setSymbol(Decoration::Start, 0, 16); + generator.setSymbol(Decoration::Start, 16, 0); + generator.setSymbol(Decoration::Exit, 8, 0); + generator.setSymbol(Decoration::Exit, 8, 16); + generator.setSymbol(Decoration::Exit, 0, 8); + generator.setSymbol(Decoration::Exit, 16, 8); + generator.generate( + 8, 8, + {{{Decoration::Triangle | Decoration::Color::Cyan, 3}, + {Decoration::Triangle | Decoration::Color::Yellow, 2}, + {Decoration::Star | Decoration::Color::Cyan, 3}, + {Decoration::Star | Decoration::Color::Yellow, 3}, + {Decoration::Stone | Decoration::Color::Cyan, 2}, + {Decoration::Stone | Decoration::Color::Yellow, 3}}}); + }, + [](Generate& generator) { + generator.setGridSize(7, 7); + generator.setSymmetry((Random::rand() % 2) == 0 + ? Panel::Symmetry::Vertical + : Panel::Symmetry::Horizontal); + generator.setFlag(Generate::WriteInvisible); + generator.setFlag(Generate::DisableDotIntersection); + MakeSecretSymmetryGrid(generator); + generator.generate( + 7, 7, + {{{Decoration::Dot | Decoration::Color::Cyan, 2}, + {Decoration::Dot | Decoration::Color::Yellow, 2}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setGridSize(7, 7); + generator.setSymmetry((Random::rand() % 2) == 0 + ? Panel::Symmetry::ParallelH + : Panel::Symmetry::ParallelV); + generator.setFlag(Generate::WriteInvisible); + generator.setFlag(Generate::DisableDotIntersection); + MakeSecretSymmetryGrid(generator); + generator.generate( + 7, 7, + {{{Decoration::Dot | Decoration::Color::Cyan, 2}, + {Decoration::Dot | Decoration::Color::Yellow, 2}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setGridSize(7, 7); + generator.setSymmetry(Panel::Symmetry::Rotational); + generator.setFlag(Generate::WriteInvisible); + generator.setFlag(Generate::DisableDotIntersection); + MakeSecretSymmetryGrid(generator); + generator.generate( + 7, 7, + {{{Decoration::Dot | Decoration::Color::Cyan, 2}, + {Decoration::Dot | Decoration::Color::Yellow, 2}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setGridSize(7, 7); + generator.setSymmetry((Random::rand() % 2) == 0 + ? Panel::Symmetry::ParallelHFlip + : Panel::Symmetry::ParallelVFlip); + generator.setFlag(Generate::WriteInvisible); + generator.setFlag(Generate::DisableDotIntersection); + MakeSecretSymmetryGrid(generator); + generator.generate( + 7, 7, + {{{Decoration::Dot | Decoration::Color::Cyan, 2}, + {Decoration::Dot | Decoration::Color::Yellow, 2}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Triangle | Decoration::Color::Orange, 15}, + {Decoration::Eraser | Decoration::Color::Purple, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Stone | Decoration::Color::White, 1}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::Red, 2}, + {Decoration::Star | Decoration::Color::White, 4}, + {Decoration::Star | Decoration::Color::Black, 3}, + {Decoration::Star | Decoration::Color::Red, 3}, + {Decoration::Decoration::Eraser | Decoration::Color::Green, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 1}, + {Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 1}, + {Decoration::Triangle | Decoration::Color::Orange, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 1}, + {Decoration::Triangle | Decoration::Color::Orange, 2}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Start, 4, 4); + generator.setSymbol(Decoration::Exit, 8, 0); + generator.generate(4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 3}, + {Decoration::Gap, 3}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Start, 4, 6); + generator.setSymbol(Decoration::Exit, 10, 0); + generator.generate(5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 3}, + {Decoration::Gap, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::DisconnectShapes); + generator.setSymbol(Decoration::Start, 4, 6); + generator.setSymbol(Decoration::Exit, 10, 0); + generator.generate(5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 3}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Exit, 10, 0); + generator.generate(5, 5, + {{{Decoration::Dot_Intersection, 36}, + {Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 1}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::BigShapes); + generator.setSymbol(Decoration::Exit, 10, 0); + generator.generate(5, 5, + {{{Decoration::Dot_Intersection, 36}, + {Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::DisconnectShapes); + generator.setSymbol(Decoration::Exit, 10, 0); + generator.generate(5, 5, + {{{Decoration::Dot_Intersection, 36}, + {Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Triangle | Decoration::Color::Magenta, 4}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 2}, + {Decoration::Star | Decoration::Color::Black, 1}, + {Decoration::Star | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Triangle | Decoration::Color::Orange, 2}, + {Decoration::Triangle | Decoration::Color::Magenta, 2}, + {Decoration::Star | Decoration::Color::Magenta, 2}, + {Decoration::Star | Decoration::Color::Green, 2}, + {Decoration::Stone | Decoration::Color::Orange, 2}, + {Decoration::Stone | Decoration::Color::Green, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 4, + {{{Decoration::Triangle | Decoration::Color::Green, 3}, + {Decoration::Triangle | Decoration::Color::Magenta, 2}, + {Decoration::Star | Decoration::Color::Magenta, 3}, + {Decoration::Star | Decoration::Color::Orange, 3}, + {Decoration::Stone | Decoration::Color::Orange, 2}, + {Decoration::Stone | Decoration::Color::Green, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Black, 1}, + {Decoration::Star | Decoration::Color::White, 2}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 1}, + {Decoration::Poly | Decoration::Can_Rotate | Decoration::Black, + 1}, + {Decoration::Poly | Decoration::Black, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Black, 1}, + {Decoration::Star | Decoration::Color::White, 2}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 1}, + {Decoration::Poly | Decoration::Can_Rotate | Decoration::Black, + 1}, + {Decoration::Poly | Decoration::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Green, 2}, + {Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Stone | Decoration::Color::Green, 2}, + {Decoration::Stone | Decoration::Color::Magenta, 2}, + {Decoration::Poly | Decoration::Can_Rotate | Decoration::Green, + 1}, + {Decoration::Poly | Decoration::Green, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.setFlag(Generate::BigShapes); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Green, 3}, + {Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Stone | Decoration::Color::Green, 2}, + {Decoration::Stone | Decoration::Color::Magenta, 2}, + {Decoration::Poly | Decoration::Can_Rotate | Decoration::Green, + 1}, + {Decoration::Poly | Decoration::Magenta, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Black, 2}, + {Decoration::Star | Decoration::Color::White, 3}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 1}, + {Decoration::Triangle | Decoration::Color::Black, 2}, + {Decoration::Triangle | Decoration::Color::White, 1}, + {Decoration::Poly | Decoration::Can_Rotate | Decoration::Black, + 1}, + {Decoration::Poly | Decoration::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Black, 3}, + {Decoration::Star | Decoration::Color::White, 3}, + {Decoration::Stone | Decoration::Color::Black, 1}, + {Decoration::Stone | Decoration::Color::White, 1}, + {Decoration::Poly | Decoration::Can_Rotate | Decoration::Black, + 1}, + {Decoration::Poly | Decoration::Can_Rotate | Decoration::White, + 1}, + {Decoration::Triangle | Decoration::Black, 1}, + {Decoration::Triangle | Decoration::White, 1}}}); + }, + [](Generate& generator) { + generator.setGridSize(5, 5); + generator.setSymbol(Decoration::Start, 10, 10); + generator.setSymbol(Decoration::Exit, 0, 0); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::White, 3}, + {Decoration::Star | Decoration::Black, 8}, + {Decoration::Star | Decoration::Magenta, 6}, + {Decoration::Eraser | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::DisconnectShapes); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 4}, + {Decoration::Eraser | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 4}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 1}, + {Decoration::Eraser | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::DisconnectShapes); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 1}, + {Decoration::Eraser | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(4, 4, + {{{Decoration::Star | Decoration::Color::Green, 7}, + {Decoration::Star | Decoration::Color::Orange, 5}, + {Decoration::Eraser | Decoration::Green, 1}, + {Decoration::Eraser | Decoration::Orange, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(5, 5, + {{{Decoration::Star | Decoration::Color::Magenta, 8}, + {Decoration::Star | Decoration::Color::Orange, 6}, + {Decoration::Star | Decoration::Color::Green, 4}, + {Decoration::Eraser | Decoration::Magenta, 1}, + {Decoration::Eraser | Decoration::Orange, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Green, 4}, + {Decoration::Eraser | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::DisconnectShapes); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Green, 4}, + {Decoration::Eraser | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Green, 2}, + {Decoration::Poly | Decoration::Color::Magenta, 1}, + {Decoration::Star | Decoration::Color::Green, 2}, + {Decoration::Star | Decoration::Color::Magenta, 2}, + {Decoration::Eraser | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(6, 3, + {{{Decoration::Star | Decoration::Color::Orange, 4}, + {Decoration::Poly | Decoration::Color::Orange, 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Magenta, + 2}, + {Decoration::Eraser | Decoration::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(6, 3, + {{{Decoration::Star | Decoration::Color::Magenta, 2}, + {Decoration::Star | Decoration::Color::Orange, 3}, + {Decoration::Poly | Decoration::Color::Orange, 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Magenta, + 2}, + {Decoration::Eraser | Decoration::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::FalseParity); + generator.setSymbol(Decoration::Exit, 0, 0); + generator.setSymbol(Decoration::Exit, 16, 0); + generator.setSymbol(Decoration::Exit, 0, 16); + generator.setSymbol(Decoration::Exit, 16, 16); + generator.generate( + 8, 8, + {{{Decoration::Stone | Decoration::Color::White, 10}, + {Decoration::Stone | Decoration::Color::Black, 10}, + {Decoration::Dot_Intersection, 81}, + {Decoration::Start, 7}, + {Decoration::Eraser | Decoration::Color::Purple, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Triangle | Decoration::Color::Orange, 5}, + {Decoration::Eraser | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 7}, + {Decoration::Stone | Decoration::Color::White, 3}, + {Decoration::Stone | Decoration::Color::Black, 3}, + {Decoration::Triangle | Decoration::Color::Orange, 6}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Exit, 10, 0); + generator.generate( + 5, 5, + {{{Decoration::Dot_Intersection, 36}, + {Decoration::Triangle1 | Decoration::Color::Orange, 4}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Exit, 10, 0); + generator.generate( + 5, 5, + {{{Decoration::Dot_Intersection, 36}, + {Decoration::Triangle3 | Decoration::Color::Orange, 6}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Exit, 10, 0); + generator.generate( + 5, 5, + {{{Decoration::Dot_Intersection, 36}, + {Decoration::Triangle2 | Decoration::Color::Orange, 10}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Exit, 10, 0); + generator.generate( + 5, 5, + {{{Decoration::Dot_Intersection, 36}, + {Decoration::Triangle | Decoration::Color::Orange, 8}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::FalseParity); + generator.generate( + 5, 5, + {{{Decoration::Dot_Intersection, 36}, + {Decoration::Triangle | Decoration::Color::Orange, 7}, + {Decoration::Eraser | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::SmallShapes); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Can_Rotate | + Decoration::Color::Orange, + 3}, + {Decoration::Poly | Decoration::Can_Rotate | + Decoration::Color::Magenta, + 2}, + {Decoration::Star | Decoration::Color::Orange, 4}, + {Decoration::Star | Decoration::Color::Magenta, 5}}}); + }, + }; + + return generator_fns; +} diff --git a/ext/wittle_generator/PuzzlesetHard.h b/ext/wittle_generator/PuzzlesetHard.h new file mode 100644 index 0000000..a4e1d7a --- /dev/null +++ b/ext/wittle_generator/PuzzlesetHard.h @@ -0,0 +1,11 @@ +#ifndef PUZZLESET_HARD_H_8D67E34F +#define PUZZLESET_HARD_H_8D67E34F + +#include +#include + +class Generate; + +const std::vector>& GetHardPuzzles(); + +#endif /* end of include guard: PUZZLESET_HARD_H_8D67E34F */ diff --git a/ext/wittle_generator/PuzzlesetMedium.cpp b/ext/wittle_generator/PuzzlesetMedium.cpp new file mode 100644 index 0000000..afc7e45 --- /dev/null +++ b/ext/wittle_generator/PuzzlesetMedium.cpp @@ -0,0 +1,596 @@ +#include "PuzzlesetMedium.h" + +#include "Generate.h" + +const std::vector>& GetMediumPuzzles() { + 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::Stone | Decoration::Color::White, 5}, + {Decoration::Stone | Decoration::Color::Black, 5}, + {Decoration::Dot, 4}, + {Decoration::Eraser | Decoration::Color::Green, 1}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Exit, 0, 0); + generator.setSymbol(Decoration::Exit, 7 * 2, 0); + generator.setSymbol(Decoration::Exit, 7 * 2, 7 * 2); + generator.generate(7, 7, + {{{Decoration::Stone | Decoration::Color::White, 10}, + {Decoration::Stone | Decoration::Color::Black, 10}, + {Decoration::Dot, 10}, + {Decoration::Start, 4}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Exit, 0, 0); + generator.setSymbol(Decoration::Exit, 7 * 2, 0); + generator.setSymbol(Decoration::Exit, 7 * 2, 7 * 2); + generator.generate( + 7, 7, + {{{Decoration::Stone | Decoration::Color::White, 10}, + {Decoration::Stone | Decoration::Color::Black, 10}, + {Decoration::Dot, 10}, + {Decoration::Eraser | Decoration::Color::Purple, 1}, + {Decoration::Start, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(5, 5, + {{{Decoration::Star | Decoration::White, 8}, + {Decoration::Star | Decoration::Black, 6}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::DisconnectShapes); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Eraser | Decoration::Color::White, 1}}}); + }, + [](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::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::RequireCancelShapes); + generator.generate(6, 6, + {{{Decoration::Dot_Intersection, 49}, + {Decoration::Poly | Decoration::Color::Yellow, 1}, + {Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 2}, + {Decoration::Poly | Decoration::Color::Blue | + Decoration::Negative, + 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Eraser | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Start, 0, 3 * 2); + generator.setSymbol(Decoration::Exit, 6 * 2, 3 * 2); + generator.generate(6, 3, + {{{Decoration::Star | Decoration::Color::Magenta, 3}, + {Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Eraser | Decoration::White, 1}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Start, 0, 3 * 2); + generator.setSymbol(Decoration::Exit, 6 * 2, 3 * 2); + generator.generate(6, 3, + {{{Decoration::Star | Decoration::Color::Magenta, 5}, + {Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Eraser | Decoration::White, 1}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Start, 0, 3 * 2); + generator.setSymbol(Decoration::Exit, 6 * 2, 3 * 2); + generator.generate(6, 3, + {{{Decoration::Star | Decoration::Color::Magenta, 6}, + {Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Eraser | Decoration::White, 1}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Start, 0, 3 * 2); + generator.setSymbol(Decoration::Exit, 7 * 2, 3 * 2); + generator.generate(7, 3, + {{{Decoration::Star | Decoration::Color::Magenta, 5}, + {Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Eraser | Decoration::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Orange, 6}, + {Decoration::Star | Decoration::Color::Magenta, 6}, + {Decoration::Star | Decoration::Color::Green, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.setFlag(Generate::FullGaps); + generator.generate(5, 5, + {{{Decoration::Star | Decoration::Color::Magenta, 8}, + {Decoration::Dot_Intersection, 9}, + {Decoration::Gap, 5}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Black, 4}, + {Decoration::Star | Decoration::Color::White, 4}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Orange, 2}, + {Decoration::Poly | Decoration::Color::Magenta, 1}, + {Decoration::Star | Decoration::Color::Magenta, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.setFlag(Generate::RequireCombineShapes); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Orange, 1}, + {Decoration::Poly | Decoration::Can_Rotate | + Decoration::Color::Orange, + 1}, + {Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Star | Decoration::Color::Green, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Orange, 3}, + {Decoration::Stone | Decoration::Color::White, 2}, + {Decoration::Stone | Decoration::Color::Black, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(4, 4, + {{{Decoration::Dot_Intersection, 25}, + {Decoration::Poly | Decoration::Can_Rotate | + Decoration::Color::Yellow, + 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::SmallShapes); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Can_Rotate | + Decoration::Color::Yellow, + 4}, + {Decoration::Star | Decoration::Color::Orange, 6}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Gap, 5}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, {{{Decoration::Poly | Decoration::Color::Yellow, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::DisconnectShapes); + generator.generate( + 4, 4, {{{Decoration::Poly | Decoration::Color::Yellow, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate(5, 5, + {{{Decoration::Poly | Decoration::Can_Rotate | + Decoration::Color::Yellow, + 2}, + {Decoration::Poly | Decoration::Color::Yellow, 1}, + {Decoration::Gap, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::BigShapes); + generator.generate(5, 5, + {{{Decoration::Poly | Decoration::Can_Rotate | + Decoration::Color::Yellow, + 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 6, {{{Decoration::Poly | Decoration::Color::Yellow, 5}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::BigShapes); + generator.generate(4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Poly | Decoration::Negative | + Decoration::Color::Blue, + 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + 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, 8}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::LongestPath); + generator.setFlag(Generate::FullGaps); + generator.generate( + 6, 6, + {{{Decoration::Dot_Intersection, 12}, {Decoration::Gap, 18}}}); + }, + [](Generate& generator) { + generator.generate(5, 5, + {{{Decoration::Start, 8}, + {Decoration::Exit, 1}, + {Decoration::Dot_Intersection, 36}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setSymmetry(Panel::Horizontal); + generator.generate( + 6, 6, + {{{Decoration::Triangle | Decoration::Color::Orange, 12}, + {Decoration::Start, 1}, + {Decoration::Exit, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Dot, 4}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 2}, + {Decoration::Star | Decoration::Color::Black, 2}, + {Decoration::Star | Decoration::Color::White, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Dot, 4}, + {Decoration::Stone | Decoration::Color::Black, 1}, + {Decoration::Stone | Decoration::Color::White, 3}, + {Decoration::Star | Decoration::Color::Black, 3}, + {Decoration::Star | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Stone | Decoration::Color::Black, 4}, + {Decoration::Stone | Decoration::Color::White, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, + {{{Decoration::Stone | Decoration::Color::Cyan, 2}, + {Decoration::Stone | Decoration::Color::Yellow, 2}, + {Decoration::Star | Decoration::Color::Cyan, 3}, + {Decoration::Star | Decoration::Color::Yellow, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 6, 6, + {{{Decoration::Stone | Decoration::Color::Cyan, 2}, + {Decoration::Stone | Decoration::Color::Magenta, 2}, + {Decoration::Star | Decoration::Color::Cyan, 2}, + {Decoration::Star | Decoration::Color::Magenta, 1}, + {Decoration::Poly | Decoration::Color::Cyan, 1}, + {Decoration::Poly | Decoration::Color::Magenta, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, {{{Decoration::Triangle | Decoration::Color::Orange, 10}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 3, + {{{Decoration::Stone | Decoration::Color::Black, 4}, + {Decoration::Stone | Decoration::Color::White, 3}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Dot, 25}, + {Decoration::Triangle | Decoration::Color::Orange, 6}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::RequireCombineShapes); + generator.setSymmetry(Panel::Rotational); + generator.generate( + 5, 5, {{{Decoration::Poly | Decoration::Color::Yellow, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::DisconnectShapes); + generator.setFlag(Generate::BigShapes); + generator.generate( + 5, 5, {{{Decoration::Poly | Decoration::Color::Yellow, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::DisconnectShapes); + generator.generate(4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow, 3}, + {Decoration::Poly | Decoration::Color::Blue | + Decoration::Negative, + 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Stone | Decoration::Color::Black, 3}, + {Decoration::Stone | Decoration::Color::White, 3}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Black, 4}, + {Decoration::Star | Decoration::Color::White, 4}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Orange, 3}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Black, 2}, + {Decoration::Star | Decoration::Color::Orange, 2}, + {Decoration::Stone | Decoration::Color::Black, 1}, + {Decoration::Stone | Decoration::Color::Orange, 1}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::BigShapes); + generator.generate( + 4, 4, + {{{Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 1}, + {Decoration::Triangle | Decoration::Color::Orange, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::BigShapes); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 1}, + {Decoration::Triangle | Decoration::Color::Orange, 6}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::BigShapes); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow, 2}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Dot, 25}, + {Decoration::Triangle | Decoration::Color::Orange, 4}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Start, 0, 4 * 2); + generator.setSymbol(Decoration::Exit, 0, 0); + generator.generate( + 4, 4, + {{{Decoration::Dot, 25}, + {Decoration::Triangle | Decoration::Color::Orange, 5}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Start, 0, 4 * 2); + generator.setSymbol(Decoration::Exit, 4 * 2, 4 * 2); + generator.generate( + 4, 4, + {{{Decoration::Dot, 25}, + {Decoration::Triangle | Decoration::Color::Orange, 5}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Dot, 25}, + {Decoration::Triangle | Decoration::Color::Orange, 6}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setFlag(Generate::DisconnectShapes); + generator.generate(5, 5, + {{{Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Black, 4}, + {Decoration::Star | Decoration::Color::White, 4}, + {Decoration::Star | Decoration::Color::Orange, 4}, + {Decoration::Stone | Decoration::Color::Black, 1}, + {Decoration::Stone | Decoration::Color::White, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 3, 3, + {{{Decoration::Stone | Decoration::Color::Magenta, 2}, + {Decoration::Stone | Decoration::Color::Green, 1}, + {Decoration::Star | Decoration::Color::Magenta, 2}, + {Decoration::Star | Decoration::Color::Green, 3}, + {Decoration::Eraser | Decoration::Color::Magenta, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{Decoration::Dot_Intersection, 25}, + {Decoration::Poly | Decoration::Color::Yellow, 3}}}); + }, + [](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::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 5, 5, + {{{Decoration::Poly | Decoration::Color::Green, 4}, + {Decoration::Star | Decoration::Color::Green, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, {{{Decoration::Triangle2 | Decoration::Color::Orange, 12}}}); + }, + [](Generate& generator) { + generator.setSymbol(Decoration::Exit, 0, 0); + generator.setSymbol(Decoration::Exit, 7 * 2, 0); + generator.setSymbol(Decoration::Exit, 7 * 2, 7 * 2); + generator.generate( + 7, 7, + {{{Decoration::Triangle | Decoration::Color::Orange, 12}, + {Decoration::Start, 3}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Orange, 1}, + {Decoration::Triangle | Decoration::Color::Orange, 7}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Orange, 3}, + {Decoration::Star | Decoration::Color::Magenta, 2}, + {Decoration::Triangle | Decoration::Color::Orange, 2}, + {Decoration::Triangle | Decoration::Color::Magenta, 2}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate(4, 4, + {{{Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Dot_Intersection, 25}}}); + }, + [](Generate& generator) { + generator.setSymmetry(Panel::Symmetry::FlipNegXY); + generator.generate(7, 7, + {{{Decoration::Gap, 10}, + {Decoration::Dot_Intersection, 8}, + {Decoration::Start, 2}, + {Decoration::Exit, 1}}}); + }, + [](Generate& generator) { + generator.setGridSize(7, 7); + generator.setSymmetry(Panel::Symmetry::ParallelV); + generator.generate(7, 7, + {{{Decoration::Gap, 12}, + {Decoration::Dot_Intersection, 10}, + {Decoration::Start, 2}, + {Decoration::Exit, 1}}}); + }, + [](Generate& generator) { + generator.setGridSize(7, 7); + generator.setSymmetry(Panel::Symmetry::ParallelHFlip); + generator.generate(7, 7, + {{{Decoration::Gap, 12}, + {Decoration::Dot_Intersection, 10}, + {Decoration::Start, 2}, + {Decoration::Exit, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::StartEdgeOnly); + generator.setSymbol(Decoration::Exit, 4 * 2, 0); + generator.generate(4, 4, + {{{Decoration::Dot_Intersection, 25}, + {Decoration::Poly | Decoration::Color::Yellow, 1}, + {Decoration::Poly | Decoration::Color::Yellow | + Decoration::Can_Rotate, + 2}, + {Decoration::Start, 1}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::RegularStartEnd); + generator.setSymmetry(Panel::Vertical); + generator.generate( + 7, 7, {{{Decoration::Poly | Decoration::Color::Yellow, 5}}}); + }, + [](Generate& generator) { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Black, 1}, + {Decoration::Star | Decoration::Color::White, 2}, + {Decoration::Stone | Decoration::Color::Black, 2}, + {Decoration::Stone | Decoration::Color::White, 1}, + {Decoration::Poly | Decoration::Can_Rotate | Decoration::Orange, + 1}, + {Decoration::Poly | Decoration::Orange, 1}}}); + }, + }; + + return generator_fns; +} diff --git a/ext/wittle_generator/PuzzlesetMedium.h b/ext/wittle_generator/PuzzlesetMedium.h new file mode 100644 index 0000000..d8f60c0 --- /dev/null +++ b/ext/wittle_generator/PuzzlesetMedium.h @@ -0,0 +1,11 @@ +#ifndef PUZZLESET_MEDIUM_H_07C331F6 +#define PUZZLESET_MEDIUM_H_07C331F6 + +#include +#include + +class Generate; + +const std::vector>& GetMediumPuzzles(); + +#endif /* end of include guard: PUZZLESET_MEDIUM_H_07C331F6 */ 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; } diff --git a/ext/wittle_generator/wittle_generator.cpp b/ext/wittle_generator/wittle_generator.cpp index 56f3d9d..5669592 100644 --- a/ext/wittle_generator/wittle_generator.cpp +++ b/ext/wittle_generator/wittle_generator.cpp @@ -4,394 +4,14 @@ #include #include "Generate.h" +#include "PuzzlesetEasy.h" +#include "PuzzlesetHard.h" +#include "PuzzlesetMedium.h" #include "Random.h" -void MakeSecretSymmetryGrid(Generate& generator) { - for (int x : {0, 6, 8, 14}) { - for (int y : {0, 6, 8, 14}) { - generator.setSymbol(Decoration::Start, x, y); - } - } - for (int x : {0, 14}) { - for (int y : {2, 4, 10, 12}) { - generator.setSymbol(Decoration::Exit, x, y); - generator.setSymbol(Decoration::Exit, y, x); - } - } -} - Rice::Object wittle_generator_generate_easy(Rice::Object /* self */) { - 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}}}); - }, - }; + const std::vector>& generator_fns = + GetEasyPuzzles(); Generate generator; @@ -405,594 +25,8 @@ Rice::Object wittle_generator_generate_easy(Rice::Object /* self */) { } Rice::Object wittle_generator_generate_medium(Rice::Object /* self */) { - 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::Stone | Decoration::Color::White, 5}, - {Decoration::Stone | Decoration::Color::Black, 5}, - {Decoration::Dot, 4}, - {Decoration::Eraser | Decoration::Color::Green, 1}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Exit, 0, 0); - generator.setSymbol(Decoration::Exit, 7 * 2, 0); - generator.setSymbol(Decoration::Exit, 7 * 2, 7 * 2); - generator.generate(7, 7, - {{{Decoration::Stone | Decoration::Color::White, 10}, - {Decoration::Stone | Decoration::Color::Black, 10}, - {Decoration::Dot, 10}, - {Decoration::Start, 4}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Exit, 0, 0); - generator.setSymbol(Decoration::Exit, 7 * 2, 0); - generator.setSymbol(Decoration::Exit, 7 * 2, 7 * 2); - generator.generate( - 7, 7, - {{{Decoration::Stone | Decoration::Color::White, 10}, - {Decoration::Stone | Decoration::Color::Black, 10}, - {Decoration::Dot, 10}, - {Decoration::Eraser | Decoration::Color::Purple, 1}, - {Decoration::Start, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate(5, 5, - {{{Decoration::Star | Decoration::White, 8}, - {Decoration::Star | Decoration::Black, 6}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::DisconnectShapes); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Eraser | Decoration::Color::White, 1}}}); - }, - [](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::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::RequireCancelShapes); - generator.generate(6, 6, - {{{Decoration::Dot_Intersection, 49}, - {Decoration::Poly | Decoration::Color::Yellow, 1}, - {Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 2}, - {Decoration::Poly | Decoration::Color::Blue | - Decoration::Negative, - 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Eraser | Decoration::Color::White, 1}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Start, 0, 3 * 2); - generator.setSymbol(Decoration::Exit, 6 * 2, 3 * 2); - generator.generate(6, 3, - {{{Decoration::Star | Decoration::Color::Magenta, 3}, - {Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Eraser | Decoration::White, 1}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Start, 0, 3 * 2); - generator.setSymbol(Decoration::Exit, 6 * 2, 3 * 2); - generator.generate(6, 3, - {{{Decoration::Star | Decoration::Color::Magenta, 5}, - {Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Eraser | Decoration::White, 1}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Start, 0, 3 * 2); - generator.setSymbol(Decoration::Exit, 6 * 2, 3 * 2); - generator.generate(6, 3, - {{{Decoration::Star | Decoration::Color::Magenta, 6}, - {Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Eraser | Decoration::White, 1}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Start, 0, 3 * 2); - generator.setSymbol(Decoration::Exit, 7 * 2, 3 * 2); - generator.generate(7, 3, - {{{Decoration::Star | Decoration::Color::Magenta, 5}, - {Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Eraser | Decoration::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 4, 4, - {{{Decoration::Star | Decoration::Color::Orange, 6}, - {Decoration::Star | Decoration::Color::Magenta, 6}, - {Decoration::Star | Decoration::Color::Green, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.setFlag(Generate::FullGaps); - generator.generate(5, 5, - {{{Decoration::Star | Decoration::Color::Magenta, 8}, - {Decoration::Dot_Intersection, 9}, - {Decoration::Gap, 5}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 4, 4, - {{{Decoration::Star | Decoration::Color::Black, 4}, - {Decoration::Star | Decoration::Color::White, 4}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Orange, 2}, - {Decoration::Poly | Decoration::Color::Magenta, 1}, - {Decoration::Star | Decoration::Color::Magenta, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.setFlag(Generate::RequireCombineShapes); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Orange, 1}, - {Decoration::Poly | Decoration::Can_Rotate | - Decoration::Color::Orange, - 1}, - {Decoration::Star | Decoration::Color::Magenta, 4}, - {Decoration::Star | Decoration::Color::Green, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Orange, 3}, - {Decoration::Stone | Decoration::Color::White, 2}, - {Decoration::Stone | Decoration::Color::Black, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate(4, 4, - {{{Decoration::Dot_Intersection, 25}, - {Decoration::Poly | Decoration::Can_Rotate | - Decoration::Color::Yellow, - 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::SmallShapes); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Can_Rotate | - Decoration::Color::Yellow, - 4}, - {Decoration::Star | Decoration::Color::Orange, 6}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate(5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Gap, 5}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, {{{Decoration::Poly | Decoration::Color::Yellow, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::DisconnectShapes); - generator.generate( - 4, 4, {{{Decoration::Poly | Decoration::Color::Yellow, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate(5, 5, - {{{Decoration::Poly | Decoration::Can_Rotate | - Decoration::Color::Yellow, - 2}, - {Decoration::Poly | Decoration::Color::Yellow, 1}, - {Decoration::Gap, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::BigShapes); - generator.generate(5, 5, - {{{Decoration::Poly | Decoration::Can_Rotate | - Decoration::Color::Yellow, - 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 6, {{{Decoration::Poly | Decoration::Color::Yellow, 5}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::BigShapes); - generator.generate(4, 4, - {{{Decoration::Poly | Decoration::Color::Yellow, 2}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - 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, 8}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::LongestPath); - generator.setFlag(Generate::FullGaps); - generator.generate( - 6, 6, - {{{Decoration::Dot_Intersection, 12}, {Decoration::Gap, 18}}}); - }, - [](Generate& generator) { - generator.generate(5, 5, - {{{Decoration::Start, 8}, - {Decoration::Exit, 1}, - {Decoration::Dot_Intersection, 36}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setSymmetry(Panel::Horizontal); - generator.generate( - 6, 6, - {{{Decoration::Triangle | Decoration::Color::Orange, 12}, - {Decoration::Start, 1}, - {Decoration::Exit, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Dot, 4}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 2}, - {Decoration::Star | Decoration::Color::Black, 2}, - {Decoration::Star | Decoration::Color::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Dot, 4}, - {Decoration::Stone | Decoration::Color::Black, 1}, - {Decoration::Stone | Decoration::Color::White, 3}, - {Decoration::Star | Decoration::Color::Black, 3}, - {Decoration::Star | Decoration::Color::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 2}, - {Decoration::Stone | Decoration::Color::Black, 4}, - {Decoration::Stone | Decoration::Color::White, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, - {{{Decoration::Stone | Decoration::Color::Cyan, 2}, - {Decoration::Stone | Decoration::Color::Yellow, 2}, - {Decoration::Star | Decoration::Color::Cyan, 3}, - {Decoration::Star | Decoration::Color::Yellow, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 6, 6, - {{{Decoration::Stone | Decoration::Color::Cyan, 2}, - {Decoration::Stone | Decoration::Color::Magenta, 2}, - {Decoration::Star | Decoration::Color::Cyan, 2}, - {Decoration::Star | Decoration::Color::Magenta, 1}, - {Decoration::Poly | Decoration::Color::Cyan, 1}, - {Decoration::Poly | Decoration::Color::Magenta, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, {{{Decoration::Triangle | Decoration::Color::Orange, 10}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 3, - {{{Decoration::Stone | Decoration::Color::Black, 4}, - {Decoration::Stone | Decoration::Color::White, 3}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Dot, 25}, - {Decoration::Triangle | Decoration::Color::Orange, 6}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::RequireCombineShapes); - generator.setSymmetry(Panel::Rotational); - generator.generate( - 5, 5, {{{Decoration::Poly | Decoration::Color::Yellow, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::DisconnectShapes); - generator.setFlag(Generate::BigShapes); - generator.generate( - 5, 5, {{{Decoration::Poly | Decoration::Color::Yellow, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::DisconnectShapes); - generator.generate(4, 4, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Poly | Decoration::Color::Blue | - Decoration::Negative, - 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Stone | Decoration::Color::Black, 3}, - {Decoration::Stone | Decoration::Color::White, 3}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Star | Decoration::Color::Black, 4}, - {Decoration::Star | Decoration::Color::White, 4}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Star | Decoration::Color::Orange, 3}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Star | Decoration::Color::Black, 2}, - {Decoration::Star | Decoration::Color::Orange, 2}, - {Decoration::Stone | Decoration::Color::Black, 1}, - {Decoration::Stone | Decoration::Color::Orange, 1}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::BigShapes); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 1}, - {Decoration::Triangle | Decoration::Color::Orange, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::BigShapes); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 1}, - {Decoration::Triangle | Decoration::Color::Orange, 6}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::BigShapes); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 2}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Dot, 25}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Start, 0, 4 * 2); - generator.setSymbol(Decoration::Exit, 0, 0); - generator.generate( - 4, 4, - {{{Decoration::Dot, 25}, - {Decoration::Triangle | Decoration::Color::Orange, 5}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Start, 0, 4 * 2); - generator.setSymbol(Decoration::Exit, 4 * 2, 4 * 2); - generator.generate( - 4, 4, - {{{Decoration::Dot, 25}, - {Decoration::Triangle | Decoration::Color::Orange, 5}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Dot, 25}, - {Decoration::Triangle | Decoration::Color::Orange, 6}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::DisconnectShapes); - generator.generate(5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 4, 4, - {{{Decoration::Star | Decoration::Color::Black, 4}, - {Decoration::Star | Decoration::Color::White, 4}, - {Decoration::Star | Decoration::Color::Orange, 4}, - {Decoration::Stone | Decoration::Color::Black, 1}, - {Decoration::Stone | Decoration::Color::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 3, 3, - {{{Decoration::Stone | Decoration::Color::Magenta, 2}, - {Decoration::Stone | Decoration::Color::Green, 1}, - {Decoration::Star | Decoration::Color::Magenta, 2}, - {Decoration::Star | Decoration::Color::Green, 3}, - {Decoration::Eraser | Decoration::Color::Magenta, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Dot_Intersection, 25}, - {Decoration::Poly | Decoration::Color::Yellow, 3}}}); - }, - [](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::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Green, 4}, - {Decoration::Star | Decoration::Color::Green, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, {{{Decoration::Triangle2 | Decoration::Color::Orange, 12}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Exit, 0, 0); - generator.setSymbol(Decoration::Exit, 7 * 2, 0); - generator.setSymbol(Decoration::Exit, 7 * 2, 7 * 2); - generator.generate( - 7, 7, - {{{Decoration::Triangle | Decoration::Color::Orange, 12}, - {Decoration::Start, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 4, 4, - {{{Decoration::Star | Decoration::Color::Orange, 1}, - {Decoration::Triangle | Decoration::Color::Orange, 7}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 4, 4, - {{{Decoration::Star | Decoration::Color::Orange, 3}, - {Decoration::Star | Decoration::Color::Magenta, 2}, - {Decoration::Triangle | Decoration::Color::Orange, 2}, - {Decoration::Triangle | Decoration::Color::Magenta, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate(4, 4, - {{{Decoration::Star | Decoration::Color::Magenta, 4}, - {Decoration::Dot_Intersection, 25}}}); - }, - [](Generate& generator) { - generator.setSymmetry(Panel::Symmetry::FlipNegXY); - generator.generate(7, 7, - {{{Decoration::Gap, 10}, - {Decoration::Dot_Intersection, 8}, - {Decoration::Start, 2}, - {Decoration::Exit, 1}}}); - }, - [](Generate& generator) { - generator.setGridSize(7, 7); - generator.setSymmetry(Panel::Symmetry::ParallelV); - generator.generate(7, 7, - {{{Decoration::Gap, 12}, - {Decoration::Dot_Intersection, 10}, - {Decoration::Start, 2}, - {Decoration::Exit, 1}}}); - }, - [](Generate& generator) { - generator.setGridSize(7, 7); - generator.setSymmetry(Panel::Symmetry::ParallelHFlip); - generator.generate(7, 7, - {{{Decoration::Gap, 12}, - {Decoration::Dot_Intersection, 10}, - {Decoration::Start, 2}, - {Decoration::Exit, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::StartEdgeOnly); - generator.setSymbol(Decoration::Exit, 4 * 2, 0); - generator.generate(4, 4, - {{{Decoration::Dot_Intersection, 25}, - {Decoration::Poly | Decoration::Color::Yellow, 1}, - {Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 2}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setSymmetry(Panel::Vertical); - generator.generate( - 7, 7, {{{Decoration::Poly | Decoration::Color::Yellow, 5}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 4, 4, - {{{Decoration::Star | Decoration::Color::Black, 1}, - {Decoration::Star | Decoration::Color::White, 2}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 1}, - {Decoration::Poly | Decoration::Can_Rotate | Decoration::Orange, - 1}, - {Decoration::Poly | Decoration::Orange, 1}}}); - }, - }; + const std::vector>& generator_fns = + GetMediumPuzzles(); Generate generator; @@ -1006,913 +40,8 @@ Rice::Object wittle_generator_generate_medium(Rice::Object /* self */) { } Rice::Object wittle_generator_generate_expert(Rice::Object /* self */) { - static std::vector> generator_fns{ - [](Generate& generator) { - generator.setFlag(Generate::StartEdgeOnly); - generator.setSymmetry(Panel::Rotational); - generator.generate( - 6, 6, - {{{Decoration::Triangle | Decoration::Color::Orange, 12}, - {Decoration::Start, 1}, - {Decoration::Exit, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::StartEdgeOnly); - generator.setFlag(Generate::WriteInvisible); - generator.setSymmetry(Panel::Rotational); - generator.generate(7, 7, - {{{Decoration::Dot | Decoration::Color::Blue, 4}, - {Decoration::Dot | Decoration::Color::Yellow, 4}, - {Decoration::Dot, 7}, - {Decoration::Start, 1}, - {Decoration::Exit, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::StartEdgeOnly); - generator.setFlag(Generate::WriteInvisible); - generator.setSymmetry(Panel::Rotational); - generator.generate(7, 7, - {{{Decoration::Stone | Decoration::Color::Black, 6}, - {Decoration::Stone | Decoration::Color::White, 6}, - {Decoration::Start, 1}, - {Decoration::Exit, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::StartEdgeOnly); - generator.setFlag(Generate::WriteInvisible); - generator.setSymmetry(Panel::Rotational); - generator.generate(7, 7, - {{{Decoration::Star | Decoration::Color::Orange, 6}, - {Decoration::Star | Decoration::Color::Green, 6}, - {Decoration::Start, 1}, - {Decoration::Exit, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::StartEdgeOnly); - generator.setFlag(Generate::WriteInvisible); - generator.setFlag(Generate::RequireCombineShapes); - generator.setSymmetry(Panel::Rotational); - generator.generate(5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Start, 1}, - {Decoration::Exit, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::StartEdgeOnly); - generator.setFlag(Generate::WriteInvisible); - generator.setSymmetry(Panel::Rotational); - generator.generate( - 7, 7, - {{{Decoration::Dot | Decoration::Color::Blue, 2}, - {Decoration::Dot | Decoration::Color::Yellow, 2}, - {Decoration::Dot, 8}, - {Decoration::Eraser | Decoration::Color::Purple, 1}, - {Decoration::Start, 1}, - {Decoration::Exit, 1}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Exit, 0, 0); - generator.setSymbol(Decoration::Exit, 0, 4 * 4); - generator.setSymbol(Decoration::Exit, 4 * 4, 0); - generator.setSymbol(Decoration::Exit, 4 * 4, 4 * 4); - generator.generate(8, 8, - {{{Decoration::Stone | Decoration::Color::White, 10}, - {Decoration::Stone | Decoration::Color::Black, 10}, - {Decoration::Dot_Intersection, 81}, - {Decoration::Start, 8}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 6, 6, - {{{Decoration::Dot_Intersection, 49}, - {Decoration::Poly | Decoration::Color::Orange, 1}, - {Decoration::Poly | Decoration::Color::Blue, 1}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 2}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Orange, - 1}, - {Decoration::Star | Decoration::Color::Orange, 4}, - {Decoration::Star | Decoration::Color::Blue, 3}, - {Decoration::Triangle | Decoration::Color::Orange, 2}, - {Decoration::Triangle | Decoration::Color::Blue, 1}, - {Decoration::Stone | Decoration::Color::Orange, 1}, - {Decoration::Stone | Decoration::Color::Blue, 2}, - {Decoration::Eraser | Decoration::Color::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setSymmetry(Panel::Rotational); - generator.generate( - 7, 7, {{{Decoration::Poly | Decoration::Color::Yellow, 5}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 2}, - {Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 1}, - {Decoration::Stone | Decoration::Color::Black, 5}, - {Decoration::Stone | Decoration::Color::White, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::BigShapes); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 2}, - {Decoration::Triangle | Decoration::Color::Orange, 3}, - {Decoration::Stone | Decoration::Color::Black, 3}, - {Decoration::Stone | Decoration::Color::White, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::StartEdgeOnly); - generator.setSymbol(Decoration::Exit, 4 * 2, 0); - generator.generate(5, 5, - {{{Decoration::Dot_Intersection, 36}, - {Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::BigShapes); - generator.setFlag(Generate::RequireCancelShapes); - generator.generate(5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 6, - {{{Decoration::Dot_Intersection, 42}, - {Decoration::Poly | Decoration::Color::Yellow, 2}, - {Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 1}, - {Decoration::Triangle | Decoration::Color::Orange, 3}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 1}, - {Decoration::Stone | Decoration::Color::Black, 4}, - {Decoration::Stone | Decoration::Color::White, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 2}, - {Decoration::Triangle | Decoration::Color::Orange, 5}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 1}, - {Decoration::Triangle | Decoration::Color::Orange, 3}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 2}, - {Decoration::Triangle | Decoration::Color::Orange, 3}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::DisconnectShapes); - generator.setFlag(Generate::BigShapes); - generator.setSymbol(Decoration::Start, 0, 5 * 2); - generator.setSymbol(Decoration::Exit, 0, 0); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 2}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 1}, - {Decoration::Triangle | Decoration::Color::Orange, 3}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::BigShapes); - generator.setSymbol(Decoration::Exit, 5 * 2, 0); - generator.generate(5, 5, - {{{Decoration::Dot_Intersection, 36}, - {Decoration::Poly | Decoration::Color::Yellow, 2}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 1}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::BigShapes); - generator.setSymbol(Decoration::Exit, 5 * 2, 0); - generator.generate(5, 5, - {{{Decoration::Dot_Intersection, 36}, - {Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 2}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::Color::Orange, 4}, - {Decoration::Triangle | Decoration::Color::Orange, 6}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::Color::Orange, 6}, - {Decoration::Triangle | Decoration::Color::Orange, 5}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::Color::Orange, 5}, - {Decoration::Triangle | Decoration::Color::Orange, 3}, - {Decoration::Stone | Decoration::Color::Orange, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate(5, 5, - {{{Decoration::Poly | Decoration::Color::Orange, 3}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 1}, - {Decoration::Star | Decoration::Color::Orange, 5}, - {Decoration::Star | Decoration::Color::Blue, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate(5, 5, - {{{Decoration::Poly | Decoration::Color::Orange, 3}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 2}, - {Decoration::Star | Decoration::Color::Orange, 5}, - {Decoration::Star | Decoration::Color::Blue, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Orange, 1}, - {Decoration::Poly | Decoration::Color::Magenta, 2}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Orange, - 2}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 2}, - {Decoration::Star | Decoration::Color::Orange, 3}, - {Decoration::Star | Decoration::Color::Blue, 3}, - {Decoration::Star | Decoration::Color::Magenta, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Magenta, 2}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 2}, - {Decoration::Star | Decoration::Color::Magenta, 3}, - {Decoration::Star | Decoration::Color::Blue, 3}, - {Decoration::Triangle | Decoration::Color::Magenta, 2}, - {Decoration::Triangle | Decoration::Color::Blue, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Orange, 1}, - {Decoration::Poly | Decoration::Color::Blue, 1}, - {Decoration::Poly | Decoration::Color::Green, 1}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 1}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Magenta, - 2}, - {Decoration::Star | Decoration::Color::Green, 2}, - {Decoration::Star | Decoration::Color::Magenta, 1}, - {Decoration::Star | Decoration::Color::Orange, 1}, - {Decoration::Star | Decoration::Color::Blue, 2}, - {Decoration::Triangle | Decoration::Color::Magenta, 2}, - {Decoration::Triangle | Decoration::Color::Orange, 1}, - {Decoration::Triangle | Decoration::Color::Green, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::Color::Orange, 4}, - {Decoration::Star | Decoration::Color::Magenta, 4}, - {Decoration::Triangle | Decoration::Color::Orange, 2}, - {Decoration::Triangle | Decoration::Color::Magenta, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::Color::Orange, 3}, - {Decoration::Star | Decoration::Color::Magenta, 3}, - {Decoration::Star | Decoration::Color::Green, 6}, - {Decoration::Triangle | Decoration::Color::Orange, 2}, - {Decoration::Triangle | Decoration::Color::Magenta, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::Color::Orange, 4}, - {Decoration::Star | Decoration::Color::Magenta, 4}, - {Decoration::Star | Decoration::Color::Green, 6}, - {Decoration::Triangle | Decoration::Color::Orange, 1}, - {Decoration::Triangle | Decoration::Color::Magenta, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::Color::Orange, 2}, - {Decoration::Star | Decoration::Color::Magenta, 2}, - {Decoration::Star | Decoration::Color::White, 2}, - {Decoration::Star | Decoration::Color::Green, 2}, - {Decoration::Star | Decoration::Color::Black, 2}, - {Decoration::Triangle | Decoration::Color::Orange, 1}, - {Decoration::Triangle | Decoration::Color::Magenta, 1}, - {Decoration::Triangle | Decoration::Color::White, 1}, - {Decoration::Triangle | Decoration::Color::Green, 1}, - {Decoration::Triangle | Decoration::Color::Black, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate(5, 5, - {{{Decoration::Star | Decoration::Color::Magenta, 4}, - {Decoration::Star | Decoration::Color::Orange, 6}, - {Decoration::Dot_Intersection, 36}}}); - }, - [](Generate& generator) { - generator.setGridSize(7, 7); - generator.setFlag(Generate::RequireCombineShapes); - generator.setSymmetry(Panel::ParallelV); - generator.setSymbol(Decoration::Start, 0, 14); - generator.setSymbol(Decoration::Start, 8, 14); - generator.setSymbol(Decoration::Exit, 6, 0); - generator.setSymbol(Decoration::Exit, 14, 0); - generator.generate( - 7, 7, {{{Decoration::Poly | Decoration::Color::Orange, 5}}}); - }, - [](Generate& generator) { - generator.setGridSize(7, 7); - generator.setFlag(Generate::RequireCombineShapes); - generator.setSymmetry(Panel::ParallelHFlip); - generator.setSymbol(Decoration::Start, 0, 14); - generator.setSymbol(Decoration::Start, 14, 6); - generator.setSymbol(Decoration::Exit, 0, 0); - generator.setSymbol(Decoration::Exit, 14, 8); - generator.generate( - 7, 7, {{{Decoration::Poly | Decoration::Color::Orange, 5}}}); - }, - [](Generate& generator) { - generator.setGridSize(7, 7); - generator.setFlag(Generate::RequireCombineShapes); - generator.setSymmetry(Panel::ParallelVFlip); - generator.setSymbol(Decoration::Start, 0, 14); - generator.setSymbol(Decoration::Start, 8, 0); - generator.setSymbol(Decoration::Exit, 6, 0); - generator.setSymbol(Decoration::Exit, 14, 14); - generator.generate( - 7, 7, {{{Decoration::Poly | Decoration::Color::Orange, 5}}}); - }, - [](Generate& generator) { - generator.setSymmetry(Panel::Symmetry::RotateLeft); - generator.setSymbol(Decoration::Start, 4, 4); - generator.setSymbol(Decoration::Start, 10, 4); - generator.setSymbol(Decoration::Start, 4, 10); - generator.setSymbol(Decoration::Start, 10, 10); - generator.setSymbol(Decoration::Exit, 4, 0); - generator.setSymbol(Decoration::Exit, 14, 4); - generator.setSymbol(Decoration::Exit, 0, 10); - generator.setSymbol(Decoration::Exit, 10, 14); - generator.generate( - 7, 7, - {{{Decoration::Triangle4 | Decoration::Color::Orange, 1}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::WriteInvisible); - generator.setFlag(Generate::StartEdgeOnly); - generator.setSymmetry(Panel::Symmetry::FlipXY); - generator.setSymbol(Decoration::Exit, 0, 8); - generator.setSymbol(Decoration::Exit, 8, 0); - generator.generate(7, 7, - {{{Decoration::Dot | Decoration::Color::Blue, 2}, - {Decoration::Dot | Decoration::Color::Yellow, 2}, - {Decoration::Dot, 8}, - {Decoration::Eraser | Decoration::Color::White, 1}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setSymmetry(Panel::Symmetry::FlipXY); - generator.setSymbol(Decoration::Start, 0, 16); - generator.setSymbol(Decoration::Start, 16, 0); - generator.setSymbol(Decoration::Exit, 8, 0); - generator.setSymbol(Decoration::Exit, 8, 16); - generator.setSymbol(Decoration::Exit, 0, 8); - generator.setSymbol(Decoration::Exit, 16, 8); - generator.generate( - 8, 8, - {{{Decoration::Triangle | Decoration::Color::Cyan, 3}, - {Decoration::Triangle | Decoration::Color::Yellow, 2}, - {Decoration::Star | Decoration::Color::Cyan, 3}, - {Decoration::Star | Decoration::Color::Yellow, 3}, - {Decoration::Stone | Decoration::Color::Cyan, 2}, - {Decoration::Stone | Decoration::Color::Yellow, 3}}}); - }, - [](Generate& generator) { - generator.setGridSize(7, 7); - generator.setSymmetry((Random::rand() % 2) == 0 - ? Panel::Symmetry::Vertical - : Panel::Symmetry::Horizontal); - generator.setFlag(Generate::WriteInvisible); - generator.setFlag(Generate::DisableDotIntersection); - MakeSecretSymmetryGrid(generator); - generator.generate( - 7, 7, - {{{Decoration::Dot | Decoration::Color::Cyan, 2}, - {Decoration::Dot | Decoration::Color::Yellow, 2}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setGridSize(7, 7); - generator.setSymmetry((Random::rand() % 2) == 0 - ? Panel::Symmetry::ParallelH - : Panel::Symmetry::ParallelV); - generator.setFlag(Generate::WriteInvisible); - generator.setFlag(Generate::DisableDotIntersection); - MakeSecretSymmetryGrid(generator); - generator.generate( - 7, 7, - {{{Decoration::Dot | Decoration::Color::Cyan, 2}, - {Decoration::Dot | Decoration::Color::Yellow, 2}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setGridSize(7, 7); - generator.setSymmetry(Panel::Symmetry::Rotational); - generator.setFlag(Generate::WriteInvisible); - generator.setFlag(Generate::DisableDotIntersection); - MakeSecretSymmetryGrid(generator); - generator.generate( - 7, 7, - {{{Decoration::Dot | Decoration::Color::Cyan, 2}, - {Decoration::Dot | Decoration::Color::Yellow, 2}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setGridSize(7, 7); - generator.setSymmetry((Random::rand() % 2) == 0 - ? Panel::Symmetry::ParallelHFlip - : Panel::Symmetry::ParallelVFlip); - generator.setFlag(Generate::WriteInvisible); - generator.setFlag(Generate::DisableDotIntersection); - MakeSecretSymmetryGrid(generator); - generator.generate( - 7, 7, - {{{Decoration::Dot | Decoration::Color::Cyan, 2}, - {Decoration::Dot | Decoration::Color::Yellow, 2}, - {Decoration::Triangle | Decoration::Color::Orange, 4}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Triangle | Decoration::Color::Orange, 15}, - {Decoration::Eraser | Decoration::Color::Purple, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Stone | Decoration::Color::White, 1}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::Red, 2}, - {Decoration::Star | Decoration::Color::White, 4}, - {Decoration::Star | Decoration::Color::Black, 3}, - {Decoration::Star | Decoration::Color::Red, 3}, - {Decoration::Decoration::Eraser | Decoration::Color::Green, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Yellow, 1}, - {Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 1}, - {Decoration::Triangle | Decoration::Color::Orange, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Yellow, 2}, - {Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 1}, - {Decoration::Triangle | Decoration::Color::Orange, 2}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 2}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Start, 4, 4); - generator.setSymbol(Decoration::Exit, 8, 0); - generator.generate(4, 4, - {{{Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 3}, - {Decoration::Gap, 3}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Start, 4, 6); - generator.setSymbol(Decoration::Exit, 10, 0); - generator.generate(5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 3}, - {Decoration::Gap, 3}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::DisconnectShapes); - generator.setSymbol(Decoration::Start, 4, 6); - generator.setSymbol(Decoration::Exit, 10, 0); - generator.generate(5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 3}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Exit, 10, 0); - generator.generate(5, 5, - {{{Decoration::Dot_Intersection, 36}, - {Decoration::Poly | Decoration::Color::Yellow, 2}, - {Decoration::Poly | Decoration::Color::Yellow | - Decoration::Can_Rotate, - 1}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::BigShapes); - generator.setSymbol(Decoration::Exit, 10, 0); - generator.generate(5, 5, - {{{Decoration::Dot_Intersection, 36}, - {Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::DisconnectShapes); - generator.setSymbol(Decoration::Exit, 10, 0); - generator.generate(5, 5, - {{{Decoration::Dot_Intersection, 36}, - {Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 4, 4, - {{{Decoration::Triangle | Decoration::Color::Magenta, 4}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 2}, - {Decoration::Star | Decoration::Color::Black, 1}, - {Decoration::Star | Decoration::Color::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 4, 4, - {{{Decoration::Triangle | Decoration::Color::Orange, 2}, - {Decoration::Triangle | Decoration::Color::Magenta, 2}, - {Decoration::Star | Decoration::Color::Magenta, 2}, - {Decoration::Star | Decoration::Color::Green, 2}, - {Decoration::Stone | Decoration::Color::Orange, 2}, - {Decoration::Stone | Decoration::Color::Green, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 4, - {{{Decoration::Triangle | Decoration::Color::Green, 3}, - {Decoration::Triangle | Decoration::Color::Magenta, 2}, - {Decoration::Star | Decoration::Color::Magenta, 3}, - {Decoration::Star | Decoration::Color::Orange, 3}, - {Decoration::Stone | Decoration::Color::Orange, 2}, - {Decoration::Stone | Decoration::Color::Green, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 4, 4, - {{{Decoration::Star | Decoration::Color::Black, 1}, - {Decoration::Star | Decoration::Color::White, 2}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 1}, - {Decoration::Poly | Decoration::Can_Rotate | Decoration::Black, - 1}, - {Decoration::Poly | Decoration::Black, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 4, 4, - {{{Decoration::Star | Decoration::Color::Black, 1}, - {Decoration::Star | Decoration::Color::White, 2}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 1}, - {Decoration::Poly | Decoration::Can_Rotate | Decoration::Black, - 1}, - {Decoration::Poly | Decoration::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::Color::Green, 2}, - {Decoration::Star | Decoration::Color::Magenta, 4}, - {Decoration::Stone | Decoration::Color::Green, 2}, - {Decoration::Stone | Decoration::Color::Magenta, 2}, - {Decoration::Poly | Decoration::Can_Rotate | Decoration::Green, - 1}, - {Decoration::Poly | Decoration::Green, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.setFlag(Generate::BigShapes); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::Color::Green, 3}, - {Decoration::Star | Decoration::Color::Magenta, 4}, - {Decoration::Stone | Decoration::Color::Green, 2}, - {Decoration::Stone | Decoration::Color::Magenta, 2}, - {Decoration::Poly | Decoration::Can_Rotate | Decoration::Green, - 1}, - {Decoration::Poly | Decoration::Magenta, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::Color::Black, 2}, - {Decoration::Star | Decoration::Color::White, 3}, - {Decoration::Stone | Decoration::Color::Black, 2}, - {Decoration::Stone | Decoration::Color::White, 1}, - {Decoration::Triangle | Decoration::Color::Black, 2}, - {Decoration::Triangle | Decoration::Color::White, 1}, - {Decoration::Poly | Decoration::Can_Rotate | Decoration::Black, - 1}, - {Decoration::Poly | Decoration::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::Color::Black, 3}, - {Decoration::Star | Decoration::Color::White, 3}, - {Decoration::Stone | Decoration::Color::Black, 1}, - {Decoration::Stone | Decoration::Color::White, 1}, - {Decoration::Poly | Decoration::Can_Rotate | Decoration::Black, - 1}, - {Decoration::Poly | Decoration::Can_Rotate | Decoration::White, - 1}, - {Decoration::Triangle | Decoration::Black, 1}, - {Decoration::Triangle | Decoration::White, 1}}}); - }, - [](Generate& generator) { - generator.setGridSize(5, 5); - generator.setSymbol(Decoration::Start, 10, 10); - generator.setSymbol(Decoration::Exit, 0, 0); - generator.generate( - 5, 5, - {{{Decoration::Star | Decoration::White, 3}, - {Decoration::Star | Decoration::Black, 8}, - {Decoration::Star | Decoration::Magenta, 6}, - {Decoration::Eraser | Decoration::Color::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::DisconnectShapes); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Yellow, 4}, - {Decoration::Eraser | Decoration::Color::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Yellow, 4}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 1}, - {Decoration::Eraser | Decoration::Color::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::DisconnectShapes); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Blue, - 1}, - {Decoration::Eraser | Decoration::Color::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate(4, 4, - {{{Decoration::Star | Decoration::Color::Green, 7}, - {Decoration::Star | Decoration::Color::Orange, 5}, - {Decoration::Eraser | Decoration::Green, 1}, - {Decoration::Eraser | Decoration::Orange, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate(5, 5, - {{{Decoration::Star | Decoration::Color::Magenta, 8}, - {Decoration::Star | Decoration::Color::Orange, 6}, - {Decoration::Star | Decoration::Color::Green, 4}, - {Decoration::Eraser | Decoration::Magenta, 1}, - {Decoration::Eraser | Decoration::Orange, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Green, 4}, - {Decoration::Eraser | Decoration::Color::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::DisconnectShapes); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Green, 4}, - {Decoration::Eraser | Decoration::Color::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 4, 4, - {{{Decoration::Poly | Decoration::Color::Green, 2}, - {Decoration::Poly | Decoration::Color::Magenta, 1}, - {Decoration::Star | Decoration::Color::Green, 2}, - {Decoration::Star | Decoration::Color::Magenta, 2}, - {Decoration::Eraser | Decoration::Color::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate(6, 3, - {{{Decoration::Star | Decoration::Color::Orange, 4}, - {Decoration::Poly | Decoration::Color::Orange, 2}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Magenta, - 2}, - {Decoration::Eraser | Decoration::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate(6, 3, - {{{Decoration::Star | Decoration::Color::Magenta, 2}, - {Decoration::Star | Decoration::Color::Orange, 3}, - {Decoration::Poly | Decoration::Color::Orange, 2}, - {Decoration::Poly | Decoration::Negative | - Decoration::Color::Magenta, - 2}, - {Decoration::Eraser | Decoration::White, 2}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::FalseParity); - generator.setSymbol(Decoration::Exit, 0, 0); - generator.setSymbol(Decoration::Exit, 16, 0); - generator.setSymbol(Decoration::Exit, 0, 16); - generator.setSymbol(Decoration::Exit, 16, 16); - generator.generate( - 8, 8, - {{{Decoration::Stone | Decoration::Color::White, 10}, - {Decoration::Stone | Decoration::Color::Black, 10}, - {Decoration::Dot_Intersection, 81}, - {Decoration::Start, 7}, - {Decoration::Eraser | Decoration::Color::Purple, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::TreehouseLayout); - generator.generate( - 4, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 3}, - {Decoration::Triangle | Decoration::Color::Orange, 5}, - {Decoration::Eraser | Decoration::Color::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Color::Yellow, 7}, - {Decoration::Stone | Decoration::Color::White, 3}, - {Decoration::Stone | Decoration::Color::Black, 3}, - {Decoration::Triangle | Decoration::Color::Orange, 6}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Exit, 10, 0); - generator.generate( - 5, 5, - {{{Decoration::Dot_Intersection, 36}, - {Decoration::Triangle1 | Decoration::Color::Orange, 4}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Exit, 10, 0); - generator.generate( - 5, 5, - {{{Decoration::Dot_Intersection, 36}, - {Decoration::Triangle3 | Decoration::Color::Orange, 6}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Exit, 10, 0); - generator.generate( - 5, 5, - {{{Decoration::Dot_Intersection, 36}, - {Decoration::Triangle2 | Decoration::Color::Orange, 10}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setSymbol(Decoration::Exit, 10, 0); - generator.generate( - 5, 5, - {{{Decoration::Dot_Intersection, 36}, - {Decoration::Triangle | Decoration::Color::Orange, 8}, - {Decoration::Start, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::FalseParity); - generator.generate( - 5, 5, - {{{Decoration::Dot_Intersection, 36}, - {Decoration::Triangle | Decoration::Color::Orange, 7}, - {Decoration::Eraser | Decoration::Color::White, 1}}}); - }, - [](Generate& generator) { - generator.setFlag(Generate::RegularStartEnd); - generator.setFlag(Generate::SmallShapes); - generator.generate( - 5, 5, - {{{Decoration::Poly | Decoration::Can_Rotate | - Decoration::Color::Orange, - 3}, - {Decoration::Poly | Decoration::Can_Rotate | - Decoration::Color::Magenta, - 2}, - {Decoration::Star | Decoration::Color::Orange, 4}, - {Decoration::Star | Decoration::Color::Magenta, 5}}}); - }, - }; + const std::vector>& generator_fns = + GetHardPuzzles(); Generate generator; -- cgit 1.4.1