function elemsToIndices(p) {
      if(!p) return p;
      let a = [];
      for(let i = 0; i < p.length; i++) {
        a[i] = CARD_STATES.indexOf(p[i]);
      }
      return a;
    }
// Converts an array of elements of CARD_STATES to indices
Converts an array of elements of CARD_STATES to indices
Converts an array of elements of CARD_STATES to indices
function elemsToIndices(p) {
      if(!p) return p;
      let a = [];
      for(let i = 0; i < p.length; i++) {
        a[i] = CARD_STATES.indexOf(p[i]);
      }
      return a;
    }
function elemsToIndices ( p ) { if ( ! p ) return p ; let a = [ ] ; for ( let i = 0 ; i < p . length ; i ++ ) { a [ i ] = CARD_STATES . indexOf ( p [ i ] ) ; } return a ; }
Converts an array of elements of CARD_STATES to indices
Converts an array of elements of CARD_STATES to indices