function path(n) {
let f0 = scale(1 / 5).f;
let f1 = shift([1 / 5, 0]).compose(scale(1 / 5)).f;
let f2 = shift([2 / 5, 0])
.compose(scale(1 / 5))
.compose(rotate(90 * degree)).f;
let f3 = shift([2 / 5, 1 / 5]).compose(scale(1 / 5)).f;
let f4 = shift([3 / 5, 1 / 5])
.compose(scale(1 / 5))
.compose(rotate(-90 * degree)).f;
let f5 = shift([3 / 5, 0]).compose(scale(1 / 5)).f;
let f6 = scale(1 / 5, [1, 0]).f;
let step = (pts) =>
pts
.map(f0)
.slice(0, -1)
.concat(pts.map(f1).slice(0, -1))
.concat(pts.map(f2).slice(0, -1))
.concat(pts.map(f3).slice(0, -1))
.concat(pts.map(f4).slice(0, -1))
.concat(pts.map(f5).slice(0, -1))
.concat(pts.map(f6));
let pts = [
[0, 0],
[1, 0]
];
for (let i = 0; i < n; i++) {
pts = step(pts);
}
return pts;
}