Workshop › Tetris-style Blocks › Step 10 of 32
Second part: a cell does not fit where the board already has a block. Rows above the top of the well count as empty, so a piece can stick out above the well for a moment.
```js
if (row >= 0 && board[row][col]) return false
```&& means "and": only inside the well (row >= 0) do we look at the board, and a filled cell there means no fit.&& stops at the first false part, board[row] is never read for a row above the well.In fits, under the walls line (if (col < 0 || ...), write the new line.
Skills: Collision detection
← Does it fit inside the well? Try, then move →