fixed invationCells spelling

Fixed invationCells to invasionCells.
Is invasion with s.
This commit is contained in:
Ángel Montero Lamas 2024-09-11 17:51:42 +02:00
parent d91fe8a8ef
commit f879b65664

View file

@ -50,14 +50,14 @@ window.Zones = (function () {
const startCell = ra(borderCells); const startCell = ra(borderCells);
if (startCell === undefined) return; if (startCell === undefined) return;
const invationCells = []; const invasionCells = [];
const queue = [startCell]; const queue = [startCell];
const maxCells = rand(5, 30); const maxCells = rand(5, 30);
while (queue.length) { while (queue.length) {
const cellId = P(0.4) ? queue.shift() : queue.pop(); const cellId = P(0.4) ? queue.shift() : queue.pop();
invationCells.push(cellId); invasionCells.push(cellId);
if (invationCells.length >= maxCells) break; if (invasionCells.length >= maxCells) break;
cells.c[cellId].forEach(neibCellId => { cells.c[cellId].forEach(neibCellId => {
if (usedCells[neibCellId]) return; if (usedCells[neibCellId]) return;