Spaces:
Running
Running
Update index.html
Browse files- index.html +1 -1
index.html
CHANGED
@@ -41,7 +41,7 @@
|
|
41 |
}
|
42 |
this.is_terminated = function () {
|
43 |
// check if the game is terminated
|
44 |
-
const num_empty_cells = this.board.reduce((a, b) => a + b);
|
45 |
if (num_empty_cells == 0) return true;
|
46 |
for (let i = 0; i < this.num_rows; i++) {
|
47 |
for (let j = 0; j < this.num_cols; j++) {
|
|
|
41 |
}
|
42 |
this.is_terminated = function () {
|
43 |
// check if the game is terminated
|
44 |
+
const num_empty_cells = this.board.reduce((a, b) => a + (b==0));
|
45 |
if (num_empty_cells == 0) return true;
|
46 |
for (let i = 0; i < this.num_rows; i++) {
|
47 |
for (let j = 0; j < this.num_cols; j++) {
|