src/canonical.cpp
// There are 13 possible ranks (2...A).  For a given street we encode the
// suit with 13 bits indicating whether that rank is present in the given
// suit.
There are 13 possible ranks (2...A).  For a given street we encode the
suit with 13 bits indicating whether that rank is present in the given
suit.
There are 13 possible ranks ( 2 ... A ) . For a given street we encode the suit with 13 bits indicating whether that rank is present in the given suit .
static int EncodeRanksOfRawSuitForStreet(int raw_suit, int street, const Card *raw_cards) {
  int street_code = 0;
  int num_cards_for_street = Game::NumCardsForStreet(street);
  for (int i = 0; i < num_cards_for_street; ++i) {
    Card raw_card = raw_cards[i];
    int this_raw_suit = Suit(raw_card);
    if (this_raw_suit == raw_suit) {
      int rank = Rank(raw_card);
      street_code |= (1 << rank);
    }
  }
  return street_code;
}
static int EncodeRanksOfRawSuitForStreet ( int raw_suit , int street , const Card * raw_cards ) { int street_code = 0 ; int num_cards_for_street = Game :: NumCardsForStreet ( street ) ; for ( int i = 0 ; i < num_cards_for_street ; ++ i ) { Card raw_card = raw_cards [ i ] ; int this_raw_suit = Suit ( raw_card ) ; if ( this_raw_suit == raw_suit ) { int rank = Rank ( raw_card ) ; street_code |= ( 1 << rank ) ; } } return street_code ; }
There are 13 possible ranks (2...A).
There are 13 possible ranks ( 2 ... A ) .