diff options
Diffstat (limited to 'ext/wittle_generator/wittle_generator.cpp')
-rw-r--r-- | ext/wittle_generator/wittle_generator.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
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 @@ | |||
1 | #include <rice/rice.hpp> | ||
2 | |||
3 | #include "Generate.h" | ||
4 | |||
5 | Rice::Object wittle_generator_generate(Rice::Object /* self */) { | ||
6 | Generate generator; | ||
7 | // generator.setFlag(Generate::RegularStartEnd); | ||
8 | /*generator.generate(4 * 2 + 1, 4 * 2 + 1, | ||
9 | {{{Decoration::Triangle | Decoration::Orange, 6}}});*/ | ||
10 | // generator.setSymmetry(Panel::Vertical); | ||
11 | generator.setSymbol(Decoration::Exit, 0, 0); | ||
12 | generator.setSymbol(Decoration::Exit, 7 * 2, 0); | ||
13 | generator.setSymbol(Decoration::Exit, 7 * 2, 7 * 2); | ||
14 | generator.generate(7 * 2 + 1, 7 * 2 + 1, | ||
15 | {{{Decoration::Stone | Decoration::Color::White, 10}, | ||
16 | {Decoration::Stone | Decoration::Color::Black, 10}, | ||
17 | {Decoration::Dot, 10}, | ||
18 | {Decoration::Start, 2}}}); | ||
19 | |||
20 | Rice::String str(generator.AsCode()); | ||
21 | return str; | ||
22 | } | ||
23 | |||
24 | extern "C" void Init_wittle_generator() { | ||
25 | Rice::Class rb_cWittleGenerator = | ||
26 | Rice::define_class("WittleGenerator") | ||
27 | .define_method("generate", &wittle_generator_generate); | ||
28 | } | ||