Skip to content

Instantly share code, notes, and snippets.

@kade-robertson
Created July 14, 2015 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kade-robertson/a1cc46055af2dc261d9c to your computer and use it in GitHub Desktop.
Save kade-robertson/a1cc46055af2dc261d9c to your computer and use it in GitHub Desktop.
lsystem SierpinskiPPCG {
    set symbols axiom = F - G - G;
    set iterations = 7;
    interpret F as DrawForward(10);
    interpret G as DrawForward(10);
    interpret - as TurnLeft(120);
    interpret + as TurnLeft(-120);
    rewrite F to F - G + F + G - F;
    rewrite G to G G;
}
process all with SvgRenderer;

Copy the above into this site to see a preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment