+ getComputerMove() {
+ let moves = this.getAllValidMoves();
+ if (moves.length == 0) return null;
+ // Random mover for now
+ const color = this.turn;
+ const m1 = moves[randInt(moves.length)];
+ this.play(m1);
+ let m = undefined;
+ if (this.turn != color) m = m1;
+ else {
+ const moves2 = this.getAllValidMoves();
+ m = [m1, moves2[randInt(moves2.length)]];
+ }
+ this.undo(m1);
+ return m;
+ }
+