var game = new gameState();

function playTurn(field) {
  cross(field);
}

function cross(field) {
  field.src = "resources/cross.png";
  field.alt = "Cross";
  field.onclick = "";
  game.fillField('X', Number(field.id.charAt(0)), Number(field.id.charAt(1)));
  document.getElementById('debug').innerHTML = game.toString();
}

function gameState(){
  this.state = [[' ', ' ', ' '],
                [' ', ' ', ' '],
                [' ', ' ', ' ']];
  this.fillField = function (pl, row, col) {this.state[row][col] = pl;};
  this.toString = function () {
    var i,j,
    str = "";
    for(i = 0; i < 3; i++) {
      str += "|";
      for (j = 0; j < 3; j++) {
        str += this.state[i][j] + "|";
      }
      str += "<br>";
    }
    return str;
  }
}

@@ -64,24 +64,48 @@
 (field);%0A%7D%0A%0A
+function aiTurn() %7B%0A%0A%7D%0A%0A
 function cro
@@ -340,24 +340,279 @@
 tring();%0A%7D%0A%0A
+function nought(field) %7B%0A  field.src = %22resources/nought.png%22;%0A  field.alt = %22Nought%22;%0A  field.onclick = %22%22;%0A  game.fillField('O', Number(field.id.charAt(0)), Number(field.id.charAt(1)));%0A  document.getElementById('debug').innerHTML = game.toString();%0A%7D%0A%0A
 function gam

add nought function