function transitionMatrix(comp) {
    let a = [];
    HAND_STATES.forEach((hand1, i) => {
      a[i] = [];
      HAND_STATES.forEach((hand2, j) => {
        /* If card c brings hand1 to hand2, increase a[i][j] by comp[c]
         * We need to iterate through each card because some hands can be reached from multiple other hands
         * ie. BUST can be reached from 12, 13, 14, etc. */
        a[i][j] = CARD_STATES.reduce((sum, card, c) =>
          sum + comp[c] * (P[i][c] === hand2), 0
        );
      });
    });

    return a;
  }
// Create transition matrix for the player on hit
Create transition matrix for the player on hit
Create transition matrix for the player on hit
function transitionMatrix(comp) {
    let a = [];
    HAND_STATES.forEach((hand1, i) => {
      a[i] = [];
      HAND_STATES.forEach((hand2, j) => {
        a[i][j] = CARD_STATES.reduce((sum, card, c) =>
          sum + comp[c] * (P[i][c] === hand2), 0
        );
      });
    });
    return a;
  }
function transitionMatrix ( comp ) { let a = [ ] ; HAND_STATES . forEach ( ( hand1 , i ) => { a [ i ] = [ ] ; HAND_STATES . forEach ( ( hand2 , j ) => { a [ i ] [ j ] = CARD_STATES . reduce ( ( sum , card , c ) => sum + comp [ c ] * ( P [ i ] [ c ] === hand2 ) , 0 ) ; } ) ; } ) ; return a ; }
Create transition matrix for the player on hit
Create transition matrix for the player on hit
/* If card c brings hand1 to hand2, increase a[i][j] by comp[c]
         * We need to iterate through each card because some hands can be reached from multiple other hands
         * ie. BUST can be reached from 12, 13, 14, etc. */