function draw(i) {
  var oldUse = document.querySelector('#svg' + i + '>use');
  var newUse = document.createElementNS(SVG_NS, 'use');
  newUse.setAttributeNS(XLINK_NS, 'href', '#generic-' +
      (turn == X_VALUE ? 'x' : 'o') + '-' +
      ((cpuFirst ? turn === X_VALUE : turn === O_VALUE)  ? 'cpu' : 'human'));
  oldUse.parentNode.replaceChild(newUse, oldUse);

  // Update the internal board, and toggle whose turn it is.
  board[i] = turn;
  turn = invert(turn);
}
// Draw a move at the specified spot.
Draw a move at the specified spot.
Draw a move at the specified spot .
function draw(i) {
  var oldUse = document.querySelector('#svg' + i + '>use');
  var newUse = document.createElementNS(SVG_NS, 'use');
  newUse.setAttributeNS(XLINK_NS, 'href', '#generic-' +
      (turn == X_VALUE ? 'x' : 'o') + '-' +
      ((cpuFirst ? turn === X_VALUE : turn === O_VALUE)  ? 'cpu' : 'human'));
  oldUse.parentNode.replaceChild(newUse, oldUse);
  board[i] = turn;
  turn = invert(turn);
}
function draw ( i ) { var oldUse = document . querySelector ( '#svg' + i + '>use' ) ; var newUse = document . createElementNS ( SVG_NS , 'use' ) ; newUse . setAttributeNS ( XLINK_NS , 'href' , '#generic-' + ( turn == X_VALUE ? 'x' : 'o' ) + '-' + ( ( cpuFirst ? turn === X_VALUE : turn === O_VALUE ) ? 'cpu' : 'human' ) ) ; oldUse . parentNode . replaceChild ( newUse , oldUse ) ; board [ i ] = turn ; turn = invert ( turn ) ; }
Draw a move at the specified spot.
Draw a move at the specified spot .
// Update the internal board, and toggle whose turn it is.