From 472719a3be3e7b6f2810aa6bad63550a1327360a Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 27 Oct 2023 22:52:44 -0400 Subject: gemspec --- ext/wittle_generator/wittle_generator.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ext/wittle_generator/wittle_generator.cpp (limited to 'ext/wittle_generator/wittle_generator.cpp') diff --git a/ext/wittle_generator/wittle_generator.cpp b/ext/wittle_generator/wittle_generator.cpp new file mode 100644 index 0000000..e8f2dba --- /dev/null +++ b/ext/wittle_generator/wittle_generator.cpp @@ -0,0 +1,28 @@ +#include + +#include "Generate.h" + +Rice::Object wittle_generator_generate(Rice::Object /* self */) { + 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}}}); + + Rice::String str(generator.AsCode()); + return str; +} + +extern "C" void Init_wittle_generator() { + Rice::Class rb_cWittleGenerator = + Rice::define_class("WittleGenerator") + .define_method("generate", &wittle_generator_generate); +} -- cgit 1.4.1