const fs = require('fs');
fs.writeFileSync("index.html", "<html><head><title>Chessboard</title></head><body><script scr="main.js"></script></body></html>", (err) => {
if (err) {
console.err(err);
return;
}
});
const chessBoard = document.createElement("div");
chessBoard.style.display = "grid";
chessBoard.style.gridTemplateColumns = "repeat(8, 1fr)";
for (let i = 0; i < 8; i++) {
for (let j = 0; j < 8; j++) {
const square = document.createElement("div");
square.style.width = "50px";
square.style.height = "50px";
square.style.backgroundColor = (i + j) % 2 === 0 ? "white" : "black";
chessBoard.appendChild(square);
}
}
document.body.appendChild(chessBoard);