function drawKoch (c) {
c.clearRect(0, 0, w * 10, h * 10);
const width = w;
const angle = degree2radian(__L.angle);
const step = __L.scale;
c.strokeStyle = '#666';
c.lineWidth = n < 4 ? 2 : 1;
c.translate(__L.left, __L.top);
c.beginPath();
c.moveTo(0, 0);
const instructions = {
'F' () {
c.beginPath();
c.moveTo(0, 0);
c.lineTo(step, 0);
c.stroke();
c.translate(step, 0);
},
'+' () {
c.rotate(angle);
},
'-' () {
c.rotate(-angle);
},
};
instructions.X = instructions.F;
instructions.Y = instructions.F;
const iterate = kochL.split('')
iterate.forEach(i => {
instructions[i]()
});
c.stroke();
}