function evaluate(board) {
    if (checkRows(board) === "O") {
        return -10
    } else if (checkRows(board) === "X") {
        return 10;
    }

    if (checkColumns(board) === "O") {
        return -10
    } else if (checkColumns(board) === "X") {
        return 10;
    }

    if (checkDiagonals(board) === "O") {
        return -10
    } else if (checkDiagonals(board) === "X") {
        return 10;
    }

    return 0;
}
// This will determine which squares/branches are winning moves

This will determine which squares/branches are winning moves
This will determine which squares / branches are winning moves
function evaluate(board) {
    if (checkRows(board) === "O") {
        return -10
    } else if (checkRows(board) === "X") {
        return 10;
    }
    if (checkColumns(board) === "O") {
        return -10
    } else if (checkColumns(board) === "X") {
        return 10;
    }
    if (checkDiagonals(board) === "O") {
        return -10
    } else if (checkDiagonals(board) === "X") {
        return 10;
    }
    return 0;
}
function evaluate ( board ) { if ( checkRows ( board ) === "O" ) { return - 10 } else if ( checkRows ( board ) === "X" ) { return 10 ; } if ( checkColumns ( board ) === "O" ) { return - 10 } else if ( checkColumns ( board ) === "X" ) { return 10 ; } if ( checkDiagonals ( board ) === "O" ) { return - 10 } else if ( checkDiagonals ( board ) === "X" ) { return 10 ; } return 0 ; }
This will determine which squares/branches are winning moves
This will determine which squares / branches are winning moves