Example #1
0
  public boolean generatePuzzle() {
    // index of the next word
    indexOfNextWord = newPuzzle.getIndexOfNextWord();
    if (indexOfNextWord == -1) {
      return false;
    }
    // get the word length of the word at the next index
    wordLength = newPuzzle.getWordLength(indexOfNextWord);
    // get number of blanks
    numBlanks = newPuzzle.howManyBlanks(wordLength);
    // get the word name at the index of the next word
    wordName = newPuzzle.getWordName(indexOfNextWord);
    // blanks out letters and returns the word with '_' (blanks)
    withBlanks = (newPuzzle.whichLettersBlank(indexOfNextWord, numBlanks));
    addSpaces();

    return true;
  }