#include #include #include "Generate.h" #include "Random.h" Rice::Object wittle_generator_generate_easy(Rice::Object /* self */) { Generate generator; int choice = Random::rand() % 46; std::cout << "Generate EASY: choice " << std::dec << choice << std::endl; switch (choice) { case 0: { 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}}}); break; } case 1: { 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}}}); break; } case 2: { generator.setFlag(Generate::RegularStartEnd); generator.setSymmetry(Panel::Rotational); generator.generate(6, 6, {{{Decoration::Gap, 15}}}); break; } case 3: { generator.setFlag(Generate::RegularStartEnd); generator.setSymmetry(Panel::Vertical); generator.generate(5, 8, {{{Decoration::Gap, 15}}}); break; } case 4: { generator.setFlag(Generate::RegularStartEnd); generator.setSymmetry(Panel::Horizontal); generator.generate(5, 5, {{{Decoration::Dot, 7}}}); break; } case 5: { generator.setFlag(Generate::RegularStartEnd); generator.setSymmetry(Panel::Rotational); generator.generate(5, 5, {{{Decoration::Dot, 6}}}); break; } case 6: { 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}}}); break; } case 7: { generator.setFlag(Generate::RegularStartEnd); generator.generate(4, 4, {{{Decoration::Poly | Decoration::Color::Yellow, 2}}}); break; } case 8: { generator.setFlag(Generate::FullGaps); generator.setFlag(Generate::StartEdgeOnly); generator.generate(5, 5, {{{Decoration::Gap, 16}, {Decoration::Dot, 10}, {Decoration::Exit, 1}, {Decoration::Start, 1}}}); break; } case 9: { generator.setFlag(Generate::RegularStartEnd); generator.generate(3, 3, {{{Decoration::Eraser | Decoration::Color::Green, 1}, {Decoration::Dot, 8}}}); break; } case 10: { 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}}}); break; } case 11: { 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}}}); break; } case 12: { 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}}}); break; } case 13: { generator.setFlag(Generate::RegularStartEnd); generator.generate( 3, 3, {{{Decoration::Poly | Decoration::Color::Yellow, 3}, {Decoration::Eraser | Decoration::Color::White, 1}}}); break; } case 14: { generator.setFlag(Generate::FullGaps); generator.generate(4, 4, {{{Decoration::Gap, 8}, {Decoration::Dot_Intersection, 10}, {Decoration::Exit, 1}, {Decoration::Start, 3}}}); break; } case 15: { generator.generate(5, 5, {{{Decoration::Exit, 1}, {Decoration::Stone | Decoration::Color::Black, 11}, {Decoration::Stone | Decoration::Color::White, 8}, {Decoration::Start, 3}}}); break; } case 16: { 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}}}); break; } case 17: { 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}}}); break; } case 18: { 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}}}); break; } case 19: { 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}}}); break; } case 20: { generator.setFlag(Generate::TreehouseLayout); generator.generate(4, 4, {{{Decoration::Star | Decoration::Color::Orange, 4}, {Decoration::Gap, 10}}}); break; } case 21: { generator.setFlag(Generate::RegularStartEnd); generator.generate(5, 5, {{{Decoration::Star | Decoration::Color::Orange, 10}, {Decoration::Gap, 3}}}); break; } case 22: { generator.setFlag(Generate::TreehouseLayout); generator.generate(4, 4, {{{Decoration::Star | Decoration::Color::Orange, 4}, {Decoration::Star | Decoration::Color::Magenta, 4}, {Decoration::Gap, 8}}}); break; } case 23: { 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}}}); break; } case 24: { 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}}}); break; } case 25: { 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}}}); break; } case 26: { 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}}}); break; } case 27: { 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}}}); break; } case 28: { 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}}}); break; } case 29: { generator.setFlag(Generate::TreehouseLayout); generator.generate( 4, 4, {{{Decoration::Poly | Decoration::Color::Orange, 2}, {Decoration::Star | Decoration::Color::Magenta, 4}}}); break; } case 30: { 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}}}); break; } case 31: { 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}}}); break; } case 32: { generator.setFlag(Generate::RegularStartEnd); generator.generate(4, 4, {{{Decoration::Dot_Intersection, 25}, {Decoration::Poly | Decoration::Color::Yellow, 2}}}); break; } case 33: { 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}}}); break; } case 34: { generator.setFlag(Generate::RegularStartEnd); generator.setSymmetry(Panel::Rotational); generator.generate(5, 5, {{{Decoration::Stone | Decoration::Color::Black, 6}, {Decoration::Stone | Decoration::Color::White, 6}}}); break; } case 35: { 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}}}); break; } case 36: { generator.setFlag(Generate::RegularStartEnd); generator.setFlag(Generate::SplitShapes); generator.generate(4, 4, {{{Decoration::Poly | Decoration::Color::Yellow, 3}, {Decoration::Gap, 8}}}); break; } case 37: { generator.setFlag(Generate::RegularStartEnd); generator.setFlag(Generate::BigShapes); generator.generate(5, 5, {{{Decoration::Poly | Decoration::Color::Yellow, 2}, {Decoration::Gap, 12}}}); break; } case 38: { generator.setFlag(Generate::RegularStartEnd); generator.setFlag(Generate::DisconnectShapes); generator.generate(3, 3, {{{Decoration::Poly | Decoration::Color::Yellow, 2}}}); break; } case 39: { generator.setFlag(Generate::RegularStartEnd); generator.setFlag(Generate::DisconnectShapes); generator.setFlag(Generate::BigShapes); generator.generate(4, 4, {{{Decoration::Poly | Decoration::Color::Yellow, 2}}}); break; } case 40: { 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}}}); break; } case 41: { 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}}}); break; } case 42: { 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}}}); break; } case 43: { 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}}}); break; } case 44: { generator.setFlag(Generate::RegularStartEnd); generator.generate( 4, 4, {{{Decoration::Triangle | Decoration::Color::Orange, 6}}}); break; } case 45: { 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}}}); break; } } Rice::String str(generator.AsCode()); return str; } Rice::Object wittle_generator_generate_medium(Rice::Object /* self */) { Generate generator; int choice = Random::rand() % 33; std::cout << "Generate MEDIUM: choice " << std::dec << choice << std::endl; switch (choice) { case 0: { 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}}}); break; } case 1: { 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}}}); break; } case 2: { 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}}}); break; } case 3: { generator.setFlag(Generate::RegularStartEnd); generator.generate(5, 5, {{{Decoration::Star | Decoration::White, 8}, {Decoration::Star | Decoration::Black, 6}}}); break; } case 4: { generator.setFlag(Generate::RegularStartEnd); generator.setFlag(Generate::DisconnectShapes); generator.generate( 4, 4, {{{Decoration::Poly | Decoration::Color::Yellow, 3}, {Decoration::Eraser | Decoration::Color::White, 1}}}); break; } case 5: { 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}}}); break; } case 6: { 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}}}); break; } case 7: { 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}}}); break; } case 8: { generator.setFlag(Generate::RegularStartEnd); generator.generate( 4, 4, {{{Decoration::Poly | Decoration::Color::Yellow, 3}, {Decoration::Eraser | Decoration::Color::White, 1}}}); break; } case 9: { 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}}}); break; } case 10: { 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}}}); break; } case 11: { 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}}}); break; } case 12: { 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}}}); break; } case 13: { 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}}}); break; } case 14: { 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}}}); break; } case 15: { 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}}}); break; } case 16: { 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}}}); break; } case 17: { 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}}}); break; } case 18: { 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}}}); break; } case 19: { generator.setFlag(Generate::RegularStartEnd); generator.generate(4, 4, {{{Decoration::Dot_Intersection, 25}, {Decoration::Poly | Decoration::Can_Rotate | Decoration::Color::Yellow, 2}}}); break; } case 20: { 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}}}); break; } case 21: { generator.setFlag(Generate::RegularStartEnd); generator.generate(5, 5, {{{Decoration::Poly | Decoration::Color::Yellow, 3}, {Decoration::Gap, 5}}}); break; } case 22: { generator.setFlag(Generate::RegularStartEnd); generator.generate(5, 5, {{{Decoration::Poly | Decoration::Color::Yellow, 4}}}); break; } case 23: { generator.setFlag(Generate::RegularStartEnd); generator.setFlag(Generate::DisconnectShapes); generator.generate(4, 4, {{{Decoration::Poly | Decoration::Color::Yellow, 3}}}); break; } case 24: { 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}}}); break; } case 25: { generator.setFlag(Generate::RegularStartEnd); generator.setFlag(Generate::BigShapes); generator.generate(5, 5, {{{Decoration::Poly | Decoration::Can_Rotate | Decoration::Color::Yellow, 3}}}); break; } case 26: { generator.setFlag(Generate::RegularStartEnd); generator.generate(5, 6, {{{Decoration::Poly | Decoration::Color::Yellow, 5}}}); break; } case 27: { 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}}}); break; } case 28: { generator.setFlag(Generate::RegularStartEnd); generator.generate( 4, 4, {{{Decoration::Poly | Decoration::Color::Yellow, 3}, {Decoration::Poly | Decoration::Negative | Decoration::Color::Blue, 2}}}); break; } case 29: { generator.setFlag(Generate::RegularStartEnd); generator.generate( 4, 4, {{{Decoration::Triangle | Decoration::Color::Orange, 8}}}); break; } case 30: { generator.setFlag(Generate::RegularStartEnd); generator.setFlag(Generate::LongestPath); generator.setFlag(Generate::FullGaps); generator.generate( 6, 6, {{{Decoration::Dot_Intersection, 12}, {Decoration::Gap, 18}}}); break; } case 31: { generator.generate(5, 5, {{{Decoration::Start, 8}, {Decoration::Exit, 1}, {Decoration::Dot_Intersection, 36}}}); break; } case 32: { generator.setFlag(Generate::RegularStartEnd); generator.setSymmetry(Panel::Horizontal); generator.generate( 6, 6, {{{Decoration::Triangle | Decoration::Color::Orange, 12}, {Decoration::Start, 1}, {Decoration::Exit, 1}}}); break; } } Rice::String str(generator.AsCode()); return str; } Rice::Object wittle_generator_generate_expert(Rice::Object /* self */) { Generate generator; int choice = Random::rand() % 8; std::cout << "Generate EXPERT: choice " << std::dec << choice << std::endl; switch (choice) { case 0: { generator.setFlag(Generate::StartEdgeOnly); generator.setSymmetry(Panel::Rotational); generator.generate( 6, 6, {{{Decoration::Triangle | Decoration::Color::Orange, 12}, {Decoration::Start, 1}, {Decoration::Exit, 1}}}); break; } case 1: { 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}}}); break; } case 2: { 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}}}); break; } case 3: { 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}}}); break; } case 4: { 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}}}); break; } case 5: { 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}}}); break; } case 6: { generator.setFlag(Generate::RegularStartEnd); generator.generate( 4, 4, {{{Decoration::Triangle | Decoration::Color::Orange, 15}, {Decoration::Eraser | Decoration::Color::Purple, 1}}}); break; } case 7: { 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}}}); break; } } Rice::String str(generator.AsCode()); return str; } extern "C" void Init_wittle_generator() { Rice::Class rb_cWittleGenerator = Rice::define_class("WittleGenerator") .define_method("generate_easy", &wittle_generator_generate_easy) .define_method("generate_medium", &wittle_generator_generate_medium) .define_method("generate_expert", &wittle_generator_generate_expert); }