Esempio n. 1
0
  public void play() {
    while (mGame.getRemainingAttempts() > 0 && !mGame.isSolved()) {
      displayProgress();
      promptForGuess();
    }

    if (mGame.isSolved()) {
      System.out.printf(
          "Congratulations! You did it with %d attempts left!", mGame.getRemainingAttempts());
    } else {
      System.out.printf("Bummer, the word was: %s\n", mGame.getAnswer());
    }
  }