src/game.cpp
// Assume the hole cards for each player have been dealt out and the board
// cards for any street prior to the given street.  How many ways of dealing
// out the remainder of the board are there?
Assume the hole cards for each player have been dealt out and the board
cards for any street prior to the given street.
Assume the hole cards for each player have been dealt out and the board cards for any street prior to the given street .
int Game::BoardPermutations(int street) {
  int num_cards_left = num_cards_in_deck_;
  num_cards_left -= 2 * num_cards_for_street_[0];
  for (int s = 1; s < street; ++s) {
    num_cards_left -= num_cards_for_street_[s];
  }
  int num_permutations = 1;
  for (int s = street; s <= max_street_; ++s) {
    int num_street_cards = num_cards_for_street_[s];
    int multiplier = 1;
    for (int n = (num_cards_left - num_street_cards) + 1; n <= num_cards_left; ++n) {
      multiplier *= n;
    }
    num_permutations *= multiplier / Factorial(num_street_cards);
    num_cards_left -= num_street_cards;
  }
  return num_permutations;
}
int Game :: BoardPermutations ( int street ) { int num_cards_left = num_cards_in_deck_ ; num_cards_left -= 2 * num_cards_for_street_ [ 0 ] ; for ( int s = 1 ; s < street ; ++ s ) { num_cards_left -= num_cards_for_street_ [ s ] ; } int num_permutations = 1 ; for ( int s = street ; s <= max_street_ ; ++ s ) { int num_street_cards = num_cards_for_street_ [ s ] ; int multiplier = 1 ; for ( int n = ( num_cards_left - num_street_cards ) + 1 ; n <= num_cards_left ; ++ n ) { multiplier *= n ; } num_permutations *= multiplier / Factorial ( num_street_cards ) ; num_cards_left -= num_street_cards ; } return num_permutations ; }
Assume the hole cards for each player have been dealt out and the board
cards for any street prior to the given street.
Assume the hole cards for each player have been dealt out and the board cards for any street prior to the given street .