scanKings(fen) {
    // Squares of white and black king:
    this.kingPos = { w: [-1, -1], b: [-1, -1] };
    const fenRows = V.ParseFen(fen).position.split("/");
    for (let i = 0; i < fenRows.length; i++) {
      let k = 0; //column index on board
      for (let j = 0; j < fenRows[i].length; j++) {
        switch (fenRows[i].charAt(j)) {
          case "k":
            this.kingPos["b"] = [i, k];
            break;
          case "K":
            this.kingPos["w"] = [i, k];
            break;
          default: {
            const num = parseInt(fenRows[i].charAt(j), 10);
            if (!isNaN(num)) k += num - 1;
          }
        }
        k++;
      }
    }
  }
// TODO: should be done from board, no need for the complete FEN
should be done from board, no need for the complete FEN
should be done from board no need for the complete FEN
scanKings(fen) {
    this.kingPos = { w: [-1, -1], b: [-1, -1] };
    const fenRows = V.ParseFen(fen).position.split("/");
    for (let i = 0; i < fenRows.length; i++) {
      let k = 0; 
      for (let j = 0; j < fenRows[i].length; j++) {
        switch (fenRows[i].charAt(j)) {
          case "k":
            this.kingPos["b"] = [i, k];
            break;
          case "K":
            this.kingPos["w"] = [i, k];
            break;
          default: {
            const num = parseInt(fenRows[i].charAt(j), 10);
            if (!isNaN(num)) k += num - 1;
          }
        }
        k++;
      }
    }
  }
scanKings ( fen ) { this . kingPos = { w : [ - 1 , - 1 ] , b : [ - 1 , - 1 ] } ; const fenRows = V . ParseFen ( fen ) . position . split ( "/" ) ; for ( let i = 0 ; i < fenRows . length ; i ++ ) { let k = 0 ; for ( let j = 0 ; j < fenRows [ i ] . length ; j ++ ) { switch ( fenRows [ i ] . charAt ( j ) ) { case "k" : this . kingPos [ "b" ] = [ i , k ] ; break ; case "K" : this . kingPos [ "w" ] = [ i , k ] ; break ; default : { const num = parseInt ( fenRows [ i ] . charAt ( j ) , 10 ) ; if ( ! isNaN ( num ) ) k += num - 1 ; } } k ++ ; } } }
TODO: should be done from board, no need for the complete FEN
TODO : should be done from board no need for the complete FEN
// Squares of white and black king: //column index on board