function drawSquare(square) {
  var g = square.getElement();
  while (g.firstChild != g.lastChild) {
    g.removeChild(g.firstChild);
  }
  var bombCount = Math.min(square.bombs, BOMB_COORDINATES.length - 1);
  var coordinates = BOMB_COORDINATES[bombCount];
  for (var i = 0, coordinate; (coordinate = coordinates[i]); i++) {
    var use = drawBomb(coordinate.x, coordinate.y, square.owner);
    g.insertBefore(use, g.firstChild);
  }
  g.setAttribute('class', 'cell-' + (bombCount ? turn : 'empty'));
}
// Erase a square and draw in the current number of bombs.
Erase a square and draw in the current number of bombs.
Erase a square and draw in the current number of bombs .
function drawSquare(square) {
  var g = square.getElement();
  while (g.firstChild != g.lastChild) {
    g.removeChild(g.firstChild);
  }
  var bombCount = Math.min(square.bombs, BOMB_COORDINATES.length - 1);
  var coordinates = BOMB_COORDINATES[bombCount];
  for (var i = 0, coordinate; (coordinate = coordinates[i]); i++) {
    var use = drawBomb(coordinate.x, coordinate.y, square.owner);
    g.insertBefore(use, g.firstChild);
  }
  g.setAttribute('class', 'cell-' + (bombCount ? turn : 'empty'));
}
function drawSquare ( square ) { var g = square . getElement ( ) ; while ( g . firstChild != g . lastChild ) { g . removeChild ( g . firstChild ) ; } var bombCount = Math . min ( square . bombs , BOMB_COORDINATES . length - 1 ) ; var coordinates = BOMB_COORDINATES [ bombCount ] ; for ( var i = 0 , coordinate ; ( coordinate = coordinates [ i ] ) ; i ++ ) { var use = drawBomb ( coordinate . x , coordinate . y , square . owner ) ; g . insertBefore ( use , g . firstChild ) ; } g . setAttribute ( 'class' , 'cell-' + ( bombCount ? turn : 'empty' ) ) ; }
Erase a square and draw in the current number of bombs.
Erase a square and draw in the current number of bombs .