Workshop › Connect Four › Step 6 of 38
One loop drew a row. A second loop around it, over the rows, draws every row: 6 × 7 = 42 holes. This is a nested loop.
```js
for (let row = 0; row < ROWS; row++) {
for (let col = 0; col < COLS; col++) {
const x = col * CELL + CELL / 2
const y = TOP + row * CELL + CELL / 2
disc(x, y, '#0f172a')
}
}
```y now depends on the row: each row is one cell lower.Put a for loop over the rows around the column loop, and add row * CELL to y.
Skills: Loops
← A whole row The board in memory →