Skip to content

Commit 756c210

Browse files
committed
7
1 parent ac984cb commit 756c210

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

garden.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11

2+
body{
3+
text-align: center;
4+
}
5+
#gameContainer{
6+
font-family: "Permanent Marker";
7+
text-align: center;
8+
margin: auto;
9+
}
210
#cellContainer{
311
display: grid;
412
grid-template-columns: repeat(3, auto);
513
width: 900px;
6-
margin: auto;
714
}
815
.cell{
916
width: 150px;

garden.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ let plants = ["", "", "", "", "", "", "", "", ""];
55
const adjacentPlants = [
66
["1", "3", "4"], //to cell 0
77
["0", "2", "3", "4", "5"], //to cell 1
8+
["1", "4", "5"], //to cell 2
89
]
9-
10+
let adjacentPlaceholder = [];
1011

1112

1213
function startgame(){
@@ -17,6 +18,7 @@ function startgame(){
1718
}
1819

1920
function cellClicked(){
21+
2022
const cellIndex = this.getAttribute("cellIndex");
2123

2224
if(plants[cellIndex] != ""){
@@ -27,9 +29,7 @@ function cellClicked(){
2729
this.textContent = "x";
2830

2931
updateCell(this, cellIndex); //"this" = current cell
30-
checkWinner();
32+
console.log("cellClicked")
3133
}
3234

33-
function updateCell(cell, index){
34-
35-
}
35+

0 commit comments

Comments
 (0)