#include #include #include #include #include #include "fractal.hpp" using namespace mtl; using namespace fractal; int main(void) { REG_DISPCNT = DCNT_MODE3 | DCNT_BG2; log::debug << "Hello world!" << mtl::endl; ruleset_t rules; try { fixed branch_angle = M_PI_4; token_id_t walk_petal_length = rules.add_token(token_type_e::walk, 8); token_id_t walk_petal_side = rules.add_token(token_type_e::walk, 4); token_id_t rotate_axiom = rules.add_token(token_type_e::rotate, M_PI_2); token_id_t rotate_petal = rules.add_token(token_type_e::rotate, M_PI_2); token_id_t rotate_branchr = rules.add_token(token_type_e::rotate, branch_angle); token_id_t rotate_branchl = rules.add_token(token_type_e::rotate, branch_angle * -2); token_id_t branch = rules.add_token(token_type_e::empty); token_id_t petal = rules.add_token(token_type_e::empty); token_id_t mark = rules.add_token(token_type_e::empty); log::info << "Added tokens" << endl; uint32_t axiom_factor = 4; etl::vector axiom_chr{ branch, rotate_axiom }; group_id_t axiom_grp = rules.add_group_characteristic(axiom_chr, axiom_factor); etl::vector branch_chr{ petal, rotate_branchr, branch, rotate_branchl, branch }; group_id_t branch_grp = rules.add_group_characteristic(branch_chr); etl::vector petal_chr{ mark, walk_petal_length, mark, rotate_petal, walk_petal_length, mark }; group_id_t petal_grp = rules.add_group_characteristic(petal_chr); log::info << "Added group characteristics" << endl; rules.add_branch_rule(branch, branch_grp); rules.add_branch_rule(petal, petal_grp); rules.add_mark_rule(mark, 1); log::info << "Added rules" << endl; log::info << "Finished configuring ruleset" << endl; } catch(const mtl::exception&) { log::info << "Failed to configure ruleset, caught exception" << endl; return 0; } while (true) { vid_vsync(); } return 0; }