1 const express = require("express");
2 const Game = require("./game.js");
4 class TicTacToe extends Game {
9 board: Array(9).fill(""),
14 /* Returns Boolean indicating whether move was legal and added. */
16 /* Cannot move to an occupied square. */
17 if (this.state.board[square])
20 this.state.board[square] = this.state.next_player;
21 this.state.moves.push(square);
23 if (this.state.next_player === "X")
24 this.state.next_player = "O";
26 this.state.next_player = "X";
32 TicTacToe.router = express.Router();
36 identifier: "tictactoe"
39 exports.Game = TicTacToe;