Template
1
0

Updated code

This commit is contained in:
2025-11-14 16:51:28 +03:00
parent 1bec3cdb97
commit 00b620a140

View File

@@ -127,6 +127,10 @@
margin-bottom: 20px;
overflow: hidden;
position: relative;
width: 400px;
height: 400px;
display: grid;
border: 3px solid gray;
}
/* Board shapes */
@@ -383,7 +387,8 @@
/* === STUDENT TASK 2: CREATE THE CHESS BOARD FUNCTION === */
// TODO: Create the createChessBoard function
/* YOUR CODE HERE */ {
/* YOUR CODE HERE */
function createChessBoard(){
const board = document.getElementById('chess-board');
// Code to create chess squares
@@ -395,7 +400,9 @@
// Outer loop for rows (0 to 7)
/* YOUR CODE HERE */ {
// Inner loop for columns (0 to 7)
/* YOUR CODE HERE */ {
for (let row = 0; row < 8; row++) {
for (let col = 0; col < 8; col++) {
// Create a cell element
const cell = document.createElement('div');