A new line of four must go through the disc that just landed, so we only look around that disc, in the four directions.
wins4(row, col) returns the first line of 4 or more, or null.
```js
const DIRECTIONS = [
[1, 0],
[0, 1],
[1, 1],
[1, -1],
]
function wins4(row, col) {
for (const dir of DIRECTIONS) {
const cells = lineThrough(row, col, dir)
if (cells.length >= 4) return cells
}
return null
}
```
What it means
DIRECTIONS lists the four directions as [dx, dy] pairs: across, down, and the two diagonals.
For each direction, if the line through the cell has 4 or more cells, return it.
Your turn
Under COLORS write DIRECTIONS.
Above function play( write wins4, followed by an empty line.