Esempio n. 1
0
  public void playGames() {
    int shoeMax = shoe.size(); // full shoe size
    double standardBet = 10;

    for (int i = 0; i < casino.getNumberOfGames(); i++) {
      double betMultiplier = strategy.getBetMultiplier(shoe.getHotness());
      double bet = standardBet * betMultiplier;

      // System.out.println("Bet = " + bet);

      games[i] = new Game(strategy, casino, shoe, bet);
      games[i].play();

      // shuffle deck when less than 25% remaining
      if ((double) shoe.size() / (double) shoeMax <= .25) {
        shoe.shuffle();
      }
    }
    solve();
  }
Esempio n. 2
0
  /**
   * Plays the given number of rounds of blackjack.
   *
   * @param numRounds the number of blackjack rounds to play
   */
  public void playRounds(int numRounds) {
    if (players.isEmpty()) {
      return;
    }

    for (int i = 0; i < numRounds; ++i) {
      newRound();

      if (shoe.needsShuffle()) {
        shoe.shuffle();
        notifyShuffle();
        shoeShuffled();
      }

      getBets();
      dealPlayers();
      if (dealHouse()) {
        // dealer did not have blackjack
        drawPlayers();
        drawHouse();
      }
      clearTable();
    }
  }