ntt123 commited on
Commit
3500001
1 Parent(s): eebe216

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +1 -2
index.html CHANGED
@@ -41,8 +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==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++) {
48
  // check winner at cell i, j
41
  }
42
  this.is_terminated = function () {
43
  // check if the game is terminated
44
+ if (this.board.some((x) => x == 0) == false) return true;
 
45
  for (let i = 0; i < this.num_rows; i++) {
46
  for (let j = 0; j < this.num_cols; j++) {
47
  // check winner at cell i, j