Coming Soon
Game play area will be implemented here
2D array manipulation with merge logic that combines adjacent equal values.
function mergeRow(row) {
const filtered = row.filter(x => x);
for (let i = 0; i < filtered.length - 1; i++) {
if (filtered[i] === filtered[i + 1]) {
filtered[i] *= 2;
filtered.splice(i + 1, 1);
}
}
return filtered;
}