Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 00b620a140 |
@@ -127,6 +127,10 @@
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
width: 400px;
|
||||||
|
height: 400px;
|
||||||
|
display: grid;
|
||||||
|
border: 3px solid gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Board shapes */
|
/* Board shapes */
|
||||||
@@ -383,7 +387,8 @@
|
|||||||
|
|
||||||
/* === STUDENT TASK 2: CREATE THE CHESS BOARD FUNCTION === */
|
/* === STUDENT TASK 2: CREATE THE CHESS BOARD FUNCTION === */
|
||||||
// TODO: Create the createChessBoard function
|
// TODO: Create the createChessBoard function
|
||||||
/* YOUR CODE HERE */ {
|
/* YOUR CODE HERE */
|
||||||
|
function createChessBoard(){
|
||||||
const board = document.getElementById('chess-board');
|
const board = document.getElementById('chess-board');
|
||||||
// Code to create chess squares
|
// Code to create chess squares
|
||||||
|
|
||||||
@@ -395,7 +400,9 @@
|
|||||||
// Outer loop for rows (0 to 7)
|
// Outer loop for rows (0 to 7)
|
||||||
/* YOUR CODE HERE */ {
|
/* YOUR CODE HERE */ {
|
||||||
// Inner loop for columns (0 to 7)
|
// 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
|
// Create a cell element
|
||||||
const cell = document.createElement('div');
|
const cell = document.createElement('div');
|
||||||
|
|||||||
Reference in New Issue
Block a user