Skip to content

Commit

Permalink
Add variables to store and track the game, and create array to store …
Browse files Browse the repository at this point in the history
…and possible wins
  • Loading branch information
atchutchi committed May 16, 2023
1 parent ed00073 commit 89cea70
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions assets/js/scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Variables to store player scores and current round
let playerXScore = 0;
let playerOScore = 0;
let currentRound = 1;

// Variables to keep track of the game mode and whether play is active
let gameMode = null;
let gameInProgress = false;

// Create an array to store each cell's value.
let board = ["", "", "", "", "", "", "", "", ""];

// Create an array with all viable winning combinations.
const winningCombinations = [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[0, 3, 6],
[1, 4, 7],
[2, 5, 8],
[0, 4, 8],
[2, 4, 6]
];

0 comments on commit 89cea70

Please sign in to comment.