From 63624385ccc66f6a2f40797baad1972957e34863 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 1 Nov 2023 10:46:56 -0400 Subject: added some treehouse expert puzzles --- ext/wittle_generator/wittle_generator.cpp | 182 +++++++++++++++++++++++++++++- 1 file changed, 180 insertions(+), 2 deletions(-) (limited to 'ext/wittle_generator') diff --git a/ext/wittle_generator/wittle_generator.cpp b/ext/wittle_generator/wittle_generator.cpp index 11bfffe..c2407cf 100644 --- a/ext/wittle_generator/wittle_generator.cpp +++ b/ext/wittle_generator/wittle_generator.cpp @@ -420,7 +420,7 @@ Rice::Object wittle_generator_generate_easy(Rice::Object /* self */) { Rice::Object wittle_generator_generate_medium(Rice::Object /* self */) { Generate generator; - int choice = Random::rand() % 63; + int choice = Random::rand() % 66; std::cout << "Generate MEDIUM: choice " << std::dec << choice << std::endl; switch (choice) { @@ -990,6 +990,31 @@ Rice::Object wittle_generator_generate_medium(Rice::Object /* self */) { {Decoration::Start, 3}}}); break; } + case 63: { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 4, 4, + {{{Decoration::Star | Decoration::Color::Orange, 1}, + {Decoration::Triangle | Decoration::Color::Orange, 7}}}); + break; + } + case 64: { + 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}}}); + break; + } + case 65: { + generator.setFlag(Generate::TreehouseLayout); + generator.generate(4, 4, + {{{Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Dot_Intersection, 25}}}); + break; + } } Rice::String str(generator.AsCode()); @@ -999,7 +1024,7 @@ Rice::Object wittle_generator_generate_medium(Rice::Object /* self */) { Rice::Object wittle_generator_generate_expert(Rice::Object /* self */) { Generate generator; - int choice = Random::rand() % 27; + int choice = Random::rand() % 40; std::cout << "Generate EXPERT: choice " << std::dec << choice << std::endl; switch (choice) { @@ -1319,6 +1344,159 @@ Rice::Object wittle_generator_generate_expert(Rice::Object /* self */) { {Decoration::Start, 1}}}); break; } + case 27: { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Orange, 4}, + {Decoration::Triangle | Decoration::Color::Orange, 6}}}); + break; + } + case 28: { + generator.setFlag(Generate::TreehouseLayout); + generator.generate( + 5, 5, + {{{Decoration::Star | Decoration::Color::Orange, 6}, + {Decoration::Triangle | Decoration::Color::Orange, 5}}}); + break; + } + case 29: { + 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}}}); + break; + } + case 30: { + 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}}}); + break; + } + case 31: { + 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}}}); + break; + } + case 32: { + 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}}}); + break; + } + case 33: { + 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}}}); + break; + } + case 34: { + 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}}}); + break; + } + case 35: { + 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}}}); + break; + } + case 36: { + 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}}}); + break; + } + case 37: { + 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}}}); + break; + } + case 38: { + 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}}}); + break; + } + case 39: { + generator.setFlag(Generate::TreehouseLayout); + generator.generate(5, 5, + {{{Decoration::Star | Decoration::Color::Magenta, 4}, + {Decoration::Star | Decoration::Color::Orange, 6}, + {Decoration::Dot_Intersection, 36}}}); + break; + } } Rice::String str(generator.AsCode()); -- cgit 1.4.1