Skip to content

Commit 5fb0888

Browse files
committed
test 4
1 parent ab158d2 commit 5fb0888

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

garden.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ const adjacentPlants = [
2424
["3", "4", "5", "6", "8"], //to cell 7
2525
["4", "5", "7"], //to cell 8
2626
];
27-
let adjacentPlantsPlaceholder;
28-
let adjacentArrayPlaceholder;
29-
let amountPlaceholder;
27+
let adjacentPlantsPlaceholder = [];
28+
let adjacentArrayPlaceholder = [];
3029

3130

3231

@@ -42,7 +41,7 @@ function startgame(){
4241

4342
function cellClicked(){
4443
const cellIndex = this.getAttribute("cellIndex");
45-
if(plants[cellIndex] == "" && this.textContent == ""){
44+
if(plants[cellIndex] == ""){
4645
plants[cellIndex] = "x"; //changing box you clicked on
4746
this.textContent = "x";
4847
let adjacentPlantsPlaceholder = adjacentPlants[cellIndex] //preping for next step

0 commit comments

Comments
 (0)