L-systems. See details. Copy this: {"step": 6, "orig": {"x": 0.1, "y": 0.1}, "dir": 20, "start": "F+", "angle": 90, "rules":["F=F+F-F-F+F"], "n":5}
e=document.createElement("input");e.style="position:fixed;z-index:9;top:0;width:99%;";e.placeholder="PASTE HERE";b.appendChild(e);e.onchange=q;q();
function q(d){p=Math.PI/180;if(d)try{d=JSON.parse(d.target.value)}catch(n){}else d={step:5,dir:0,start:"F",n:5,angle:90,orig:{x:0,y:0},rules:["F=F+F-F-F+F"]};o=[a.width*d.orig.x,a.height*d.orig.y];r=t(d.rules);z=u(d.angle*p);k=v(d.start,r,d.n);h=z(k);c.save();c.clearRect(0,0,a.width,a.height);var f=d.step;d=d.dir*p;c.translate(o[0],o[1]);c.beginPath();c.rotate(d);i=0;for(l=h.length;i<l;i++)g=h[i],c.rotate(g.a),g.b&&(m=g.d?"lineTo":"moveTo",c[m](f,0),c.translate(f,0));c.stroke();c.restore()}
function v(d,f,n){if(!n)return d;y=d.split("").map(function(d){return f[d]?f[d]:d}).join("");return v(y,f,n-1)}function t(d){return d.reduce(function(d,n){x=n.split("=");d[x[0]]=x[1];return d},{})}function u(d){return function(f){w={"+":{a:d,b:0,d:0},"-":{a:-1*d,b:0,d:0},F:{a:0,b:1,d:1},G:{a:0,b:1,d:1},M:{a:0,b:1,d:0}};return f.split("").map(function(d){return w[d]?w[d]:d})}}
ZT1kb2N1bWVudC5jcmVhdGVFbGVtZW50KCJpbnB1dCIpO2Uuc3R5bGU9InBvc2l0aW9uOmZpeGVkO3otaW5kZXg6OTt0b3A6MDt3aWR0aDo5OSU7IjtlLnBsYWNlaG9sZGVyPSJQQVNURSBIRVJFIjtiLmFwcGVuZENoaWxkKGUpO2Uub25jaGFuZ2U9cTtxKCk7DQpmdW5jdGlvbiBxKGQpe3A9TWF0aC5QSS8xODA7aWYoZCl0cnl7ZD1KU09OLnBhcnNlKGQudGFyZ2V0LnZhbHVlKX1jYXRjaChuKXt9ZWxzZSBkPXtzdGVwOjUsZGlyOj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