/**
* Pseudocode for minmax algorithm (without alpha beta pruning)
* initilize call - minmax(node, 1, true);
*/
DEPTH = null;
SIZE = 3;
minmax(node, depth, isMax){
if(DEPTH != null && depth == DEPTH){
return heuristicValue;
}
var minmaxResult = [];
var choices = [];
for(var i = 0; i < SIZE; ++i){
for(var j = 0; j < SIZE; ++j){
if(node[i][j] == null){ // fill if its an empty cell
var childNode = node;
childNode[i][j] = isMax ? 1 : -1;
choices.push(i + "," + j);
if(gameWon(childNode) || gameDraw(childNode)){