Skip to content

Instantly share code, notes, and snippets.

View andrew-t-james's full-sized avatar
💭
🤔

Andrew James andrew-t-james

💭
🤔
View GitHub Profile
@andrew-t-james
andrew-t-james / gamelogic.js
Created July 7, 2020 03:32 — forked from LearningNerd/gamelogic.js
Tic Tac Toe in the command line with NodeJS. Run with: node playtictactoe.js
module.exports = class TicTacToe {
constructor() {
this.board = [
["", "", ""],
["", "", ""],
["", "", ""]
];
this.currentPlayer = "X";
this.lastMove; // keep track of most recent move, for hasWon() check