Open bingqing46 opened 4 years ago
官方的答案,我的答案是错误的,而且没有任何技巧可言
var size = 8;
var board = "";
for (var y = 0; y < size; y++) {
for (var x = 0; x < size; x++) {
if ((x + y) % 2 == 0)
board += " ";
else
board += "#";
}
board += "\n";
}
console.log(board);