js/logic.js
//function to randomly choose a square for the computer to play in based on what's available. gets called from presentation.js at same time as running the playturn function for the computer.
function to randomly choose a square for the computer to play in based on what's available. gets called from presentation.js at same time as running the playturn function for the computer.
function to randomly choose a square for the computer to play in based on what ' s available . gets called from presentation . js at same time as running the playturn function for the computer .
function chooseSquareAI() {
    var availableSquares = [];
    for (var key in this.boardStatus) {
      if (this.boardStatus[key] === "empty") {
        availableSquares.push(key);
      }
    }
    var chosenSquare = availableSquares[Math.floor(Math.random() * availableSquares.length)];
    return chosenSquare;
  }
function chooseSquareAI ( ) { var availableSquares = [ ] ; for ( var key in this . boardStatus ) { if ( this . boardStatus [ key ] === "empty" ) { availableSquares . push ( key ) ; } } var chosenSquare = availableSquares [ Math . floor ( Math . random ( ) * availableSquares . length ) ] ; return chosenSquare ; }
function to randomly choose a square for the computer to play in based on what's available.
function to randomly choose a square for the computer to play in based on what ' s available .