Anonymous user
Knight's tour: Difference between revisions
→Procedural
m (→Functiona JSl) |
|||
Line 3,520:
};
this.ctx = null;
this.step =
this.lastTime = 0;
this.wait;
Line 3,537:
drawBoard() {
let a = false, xx, yy;
for (let y = 0; y < this.
for (let x = 0; x < this.
if (a) {
this.ctx.fillStyle = "#607db8";
Line 3,546:
}
a = !a;
yy = y * this.step;
this.ctx.fillRect(xx, yy, xx + this.step, yy + this.step);
}
if (!(this.cellCount & 1)) a = !a;
Line 3,786 ⟶ 3,788:
line-height: 16px;
}</pre>
===Functional===
|