Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.38 KB | None | 0 0
  1. package code;
  2.  
  3. import java.io.IOException;
  4. import java.nio.file.Files;
  5. import java.nio.file.Paths;
  6. import java.util.ArrayList;
  7. import java.util.HashMap;
  8. import java.util.HashSet;
  9.  
  10. public class Model {
  11.  
  12.     // Determines the maximum length of a word
  13.     private static final int MAXIMUM_WORD_LENGTH = 7;
  14.  
  15.     // Determines the maximum length of a word
  16.     private static final int MINIMUM_WORD_LENGTH = 3;
  17.  
  18.     // Holds all words from the dictionary file that have lengths between the max and min, inclusive
  19.     private ArrayList<String> _words;
  20.    
  21.     // Holds all words from the dictionary file that have the max length
  22.     private ArrayList<String> _seedWords;
  23.    
  24.     // Holds all words from _words that must be found by the player
  25.     private HashMap<String,Boolean> _wordsToFind;
  26.  
  27.    
  28.     /* QUESTION 1
  29.      *
  30.      * The constructor
  31.      *
  32.      * The job of the constructor is to assign sensible initial values to each instance variable.
  33.      * To _words it should assign the value returned by readDictionaryFromFile, with the filename passed in as argument
  34.      * To _seedWords it should assign the value returned by filterWordsForLength,  with _words and the maximum word length passed in as arguments
  35.      * To _wordsToFind it should assign the value null.
  36.      *
  37.      * @param filename - the name of a file of words (a "dictionary file")
  38.      */
  39.     public Model(String filename) {
  40.        
  41.        
  42.         // TODO Auto-generated method stub
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement