Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package code;
- import java.io.IOException;
- import java.nio.file.Files;
- import java.nio.file.Paths;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.HashSet;
- public class Model {
- // Determines the maximum length of a word
- private static final int MAXIMUM_WORD_LENGTH = 7;
- // Determines the maximum length of a word
- private static final int MINIMUM_WORD_LENGTH = 3;
- // Holds all words from the dictionary file that have lengths between the max and min, inclusive
- private ArrayList<String> _words;
- // Holds all words from the dictionary file that have the max length
- private ArrayList<String> _seedWords;
- // Holds all words from _words that must be found by the player
- private HashMap<String,Boolean> _wordsToFind;
- /* QUESTION 1
- *
- * The constructor
- *
- * The job of the constructor is to assign sensible initial values to each instance variable.
- * To _words it should assign the value returned by readDictionaryFromFile, with the filename passed in as argument
- * To _seedWords it should assign the value returned by filterWordsForLength, with _words and the maximum word length passed in as arguments
- * To _wordsToFind it should assign the value null.
- *
- * @param filename - the name of a file of words (a "dictionary file")
- */
- public Model(String filename) {
- // TODO Auto-generated method stub
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement