var canvas = document.getElementById("scene");
var ctx = canvas.getContext("2d");
var size = 64;
function drawBpard()
{
for(var i=0; i<8; i++)
{
for(var j=0; j<8; j++)
{
if(i%2 == 0)
{
if(j%2 == 0)
{
ctx.fillStyle = "black";
}
else
{
ctx.fillStyle = "white";
}
}
else
{
if(j%2 != 0)
{
ctx.fillStyle = "black";
}
else
{
ctx.fillStyle = "white";
}
}
ctx.fillRect(size*i, size*j, size, size);
}
}
}
drawBpard();
black и white местами поменяй в обоих блоках. Инвертируешь доску.