Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save JeremyLikness/0d5c68e9eb20e779b60b764346236108 to your computer and use it in GitHub Desktop.

Select an option

Save JeremyLikness/0d5c68e9eb20e779b60b764346236108 to your computer and use it in GitHub Desktop.
draw = true;
for (let x = 0; draw && x < this.winLines.length; x += 1) {
draw = this.draw(this.winLines[x]);
}
if (draw) {
this.gameState = GameState.Draw;
return;
}
this.gameState = this.gameState === GameState.XTurn ? GameState.OTurn : GameState.XTurn;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment