From b21f37b598bdf2bb901423f11b7708d81f99966b Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 18 Nov 2023 13:54:21 -0500 Subject: centre-start polys, more puzzles --- ext/wittle_generator/Panel.cpp | 2 +- ext/wittle_generator/wittle_generator.cpp | 364 +++++++++++++++++++++++++++++- 2 files changed, 363 insertions(+), 3 deletions(-) (limited to 'ext/wittle_generator') diff --git a/ext/wittle_generator/Panel.cpp b/ext/wittle_generator/Panel.cpp index 3279943..e61192c 100644 --- a/ext/wittle_generator/Panel.cpp +++ b/ext/wittle_generator/Panel.cpp @@ -221,7 +221,7 @@ std::string Panel::Write() { serializer.writeInt(0); char settings = Serializer::NegationsCancelNegations | - Serializer::PrecisePolyominos | Serializer::FlashForErrors; + Serializer::ShapelessZeroPoly | Serializer::FlashForErrors; if (_invisible_symmetry) { settings |= Serializer::InvisibleSymmetry; } diff --git a/ext/wittle_generator/wittle_generator.cpp b/ext/wittle_generator/wittle_generator.cpp index 77096c7..1c7abfc 100644 --- a/ext/wittle_generator/wittle_generator.cpp +++ b/ext/wittle_generator/wittle_generator.cpp @@ -978,6 +978,18 @@ Rice::Object wittle_generator_generate_medium(Rice::Object /* self */) { 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}}}); + }, }; Generate generator; @@ -1209,7 +1221,6 @@ Rice::Object wittle_generator_generate_expert(Rice::Object /* self */) { {Decoration::Stone | Decoration::Color::White, 2}}}); }, [](Generate& generator) { - generator.setFlag(Generate::StartEdgeOnly); generator.setFlag(Generate::BigShapes); generator.setSymbol(Decoration::Exit, 5 * 2, 0); generator.generate(5, 5, @@ -1221,7 +1232,6 @@ Rice::Object wittle_generator_generate_expert(Rice::Object /* self */) { {Decoration::Start, 1}}}); }, [](Generate& generator) { - generator.setFlag(Generate::StartEdgeOnly); generator.setFlag(Generate::BigShapes); generator.setSymbol(Decoration::Exit, 5 * 2, 0); generator.generate(5, 5, @@ -1548,6 +1558,356 @@ Rice::Object wittle_generator_generate_expert(Rice::Object /* self */) { {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.setFlag(Generate::RegularStartEnd); + generator.generate( + 4, 4, + {{{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}}}); + }, }; Generate generator; -- cgit 1.4.1