Пример #1
0
    private RenderQueue getKochSnowflake(int numGenerations)
    {
        // rule: F --> F-F++F-F
        RenderCommand[] ruleFrom = { RenderCommand.FORWARD };
        RenderQueue[]   ruleTo   = { RenderQueue.fromString("F-F++F-F") };
        Rewriter        rewriter = new Rewriter(ruleFrom, ruleTo);

        RenderQueue seed = RenderQueue.fromString("F++F++F");

        return(rewriter.rewrite(seed, numGenerations));
    }