doClick(square) {
    const c = this.turn;
    if (
      this.movesCount >= 2 ||
      (
        (c == 'w' && square[0] < 6) ||
        (c == 'b' && square[0] > 1)
      )
    ) {
      return null;
    }
    const [x, y] = square;
    const piece = super.getPiece(x, y);
    if (piece == V.KING) return null; //no bomb on king!
    return new Move({
      appear: [ new PiPo({ x: x, y: y, c: c, p: V.BOMB_CODE[piece] }) ],
      vanish: [ new PiPo({ x: x, y: y, c: c, p: piece }) ],
      start: { x: -1, y: -1 },
      end: { x: x, y: y, noHighlight: true }
    });
  }
// Initiate the game by choosing a piece holding the bomb:
Initiate the game by choosing a piece holding the bomb.
Initiate the game by choosing a piece holding the bomb .
doClick(square) {
    const c = this.turn;
    if (
      this.movesCount >= 2 ||
      (
        (c == 'w' && square[0] < 6) ||
        (c == 'b' && square[0] > 1)
      )
    ) {
      return null;
    }
    const [x, y] = square;
    const piece = super.getPiece(x, y);
    if (piece == V.KING) return null; 
    return new Move({
      appear: [ new PiPo({ x: x, y: y, c: c, p: V.BOMB_CODE[piece] }) ],
      vanish: [ new PiPo({ x: x, y: y, c: c, p: piece }) ],
      start: { x: -1, y: -1 },
      end: { x: x, y: y, noHighlight: true }
    });
  }
doClick ( square ) { const c = this . turn ; if ( this . movesCount >= 2 || ( ( c == 'w' && square [ 0 ] < 6 ) || ( c == 'b' && square [ 0 ] > 1 ) ) ) { return null ; } const [ x , y ] = square ; const piece = super . getPiece ( x , y ) ; if ( piece == V . KING ) return null ; return new Move ( { appear : [ new PiPo ( { x : x , y : y , c : c , p : V . BOMB_CODE [ piece ] } ) ] , vanish : [ new PiPo ( { x : x , y : y , c : c , p : piece } ) ] , start : { x : - 1 , y : - 1 } , end : { x : x , y : y , noHighlight : true } } ) ; }
Initiate the game by choosing a piece holding the bomb:
Initiate the game by choosing a piece holding the bomb :
//no bomb on king!