forked from technolyceum/g11-m2
Completed
This commit is contained in:
@@ -120,7 +120,10 @@
|
|||||||
|
|
||||||
/* TODO: Add a 3px solid gray border */
|
/* TODO: Add a 3px solid gray border */
|
||||||
/* YOUR CODE HERE */
|
/* YOUR CODE HERE */
|
||||||
|
width: 400px;
|
||||||
|
height: 400px;
|
||||||
|
display: grid;
|
||||||
|
border: 3px solid gray;
|
||||||
grid-template-columns: repeat(var(--grid-size), 1fr);
|
grid-template-columns: repeat(var(--grid-size), 1fr);
|
||||||
grid-template-rows: repeat(var(--grid-size), 1fr);
|
grid-template-rows: repeat(var(--grid-size), 1fr);
|
||||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
|
||||||
@@ -375,7 +378,7 @@
|
|||||||
announceBtn.addEventListener('click', announceGameState);
|
announceBtn.addEventListener('click', announceGameState);
|
||||||
|
|
||||||
// Initialize the chess board
|
// Initialize the chess board
|
||||||
function initializeGame() {
|
function createChessBoard() {
|
||||||
createBoard();
|
createBoard();
|
||||||
setupPieces();
|
setupPieces();
|
||||||
updateGameStatus();
|
updateGameStatus();
|
||||||
@@ -393,7 +396,8 @@
|
|||||||
/* === STUDENT TASK 3: CREATE NESTED FOR LOOPS === */
|
/* === STUDENT TASK 3: CREATE NESTED FOR LOOPS === */
|
||||||
// TODO: Create nested for loops to make an 8x8 grid
|
// TODO: Create nested for loops to make an 8x8 grid
|
||||||
// Outer loop for rows (0 to 7)
|
// Outer loop for rows (0 to 7)
|
||||||
/* YOUR CODE HERE */ {
|
for (let row = 0; row < 8; row++) {
|
||||||
|
for (let col = 0; col < 8; col++) {
|
||||||
// Inner loop for columns (0 to 7)
|
// Inner loop for columns (0 to 7)
|
||||||
/* YOUR CODE HERE */ {
|
/* YOUR CODE HERE */ {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user