xxxxxxxxxx
29
// https://jscompress.com/
// #つぶやきProcessing
setup = _ => {
createCanvas((s = 720), s);
strokeWeight(9);
stroke("orange");
b = 0.25;
r = { L: "+RF-LFL-FR+", R: "-LF+RFR+FL-" };
x = 0;
y = 0;
a = 0;
n=31/s;
f = (s, d) => {
[s].map((c) => {
if (c == "+") a -= b;
else if (c == "-") a += b;
else {
if (d > 1 && r[c]) f(r[c], d - 1);
else if (c == "F")
line(x, y, x=x + cos(a * TAU) / n, y=y + sin(a * TAU) / n);
}
});
};
f("R", 6);
// save();
};