scanKings(fen) {
    this.kingPos = { w: [-1, -1], b: [-1, -1] };
    const fenRows = V.ParseFen(fen).position.split("/");
    const startRow = { 'w': V.size.x - 1, 'b': 0 };
    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++;
      }
    }
  }
// Scanning king position for faster updates is still interesting.
Scanning king position for faster updates is still interesting.
Scanning king position for faster updates is still interesting .
scanKings(fen) {
    this.kingPos = { w: [-1, -1], b: [-1, -1] };
    const fenRows = V.ParseFen(fen).position.split("/");
    const startRow = { 'w': V.size.x - 1, 'b': 0 };
    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 ( "/" ) ; const startRow = { 'w' : V . size . x - 1 , 'b' : 0 } ; 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 ++ ; } } }
Scanning king position for faster updates is still interesting.
Scanning king position for faster updates is still interesting .