Workshop › 2048 › Step 18 of 26
The game is not over when the board is full: a full board can still have merges. It is over when there is no empty cell and no two equal tiles side by side or one above the other.
```js
// Any empty cell, or two equal neighbours (checking right and below covers every pair once).
function canMove() {
for (let row = 0; row < SIZE; row++) {
for (let col = 0; col < SIZE; col++) {
const value = board[row][col]
if (value === 0) return true
if (col < SIZE - 1 && value === board[row][col + 1]) return true
if (row < SIZE - 1 && value === board[row + 1][col]) return true
}
}
return false
}
```return true.col < SIZE - 1 makes sure there is a right neighbour before looking at it (the last column has none); the same
for the row below.false.Write the comment and canMove above the comment // Every direction is ..., with an empty line after it.
Skills: Loops