/** * CS149 - Introduction to Programming * Department of Computer Science * James Madison University * @version Fall 2018 */

See submission details below for all due dates and submission details. Note there are multiple submission parts.
This assignment should be completed individually to maximize learning. It is important that you adhere to the Course Policies, particularly the section on Programming Assignments. Also relevant is the JMU Honor Code.
After a correct guess, the tiles that constituted the guess are permanently removed from the board. After an incorrect guess, the tiles that constituted the guess are returned to the board (i.e., made available for another guess).
Note that the author does not create the tiles, the program creates them from the words using a slicing algorithm.
An outside author created three game files that you can use for testing.
Computer Science Terms
JMU People
Nets
Of course, you can easily create more.
You are responsible for implementing the classes in black. The
.class files for the classes in blue are available
from the following links.
GameBoard
Tile
GuessField
FileUtilities
FileUtilities.java
Note this latter source code is being provided as there are a few people that are having issues with getting the
FileUtilities class to show up. Please be aware that this may not solve all of your problems when you submit to
AutoLab and even more important do not submit this file or the corresponding class file with your submission. If
you change this file your code will not be compatible with AutoLab.
The first three are part of the graphical user interface (GUI), the
last is a utility class for reading files. Note that you do not
need to (and should not) use the Tile
and GuessField classes directly, they are used by the
GameBoard class. The purpose of the methods in the other
classes should be apparent from their names.
SevenLittleWords.
It must:
GameInfo object using
the file name passed to it as command-line argument 0.
If no such argument is provided, it must print an appropriate
error message on the console and terminate.GameBoard using the GameInfo
object. If the GameInfo object isn't read
properly/completely, it must instead print an appropriate
error message on the console and terminate.GameBoard object by calling its
setVisible() method and passing it the value
true.Slice is a two-letter or three-letter portion of a word.
A Slice can either be in the used state or the unused state.
When a Slice is in the unused state its toString()
must return its text. However, when it is in the used state it must return
the empty String (i.e., "").
It must be possible to put a Slice in the used state by calling
its use() method. On the other hand, it must be possible to put
it into the unused state by calling its reset() method.
Its isUsed() method must return true when it
is in the used state and false otherwise.
WordUtilities class
is slice(). It must create the slices for the word it
is passed in a manner that is consistent with the following
specifications.
For example, the word "Madison" has the slices "MAD", "IS", and "ON".
The array that is returned by this method must contain the appropriate number of slices, no more and no fewer.
Note that, though the game has the modifier "little" in its name, this method must work correctly for any parameter that has two or more characters.
WordClue is a pair that contains a word along with
its associated clue and slices.
The constructor must initialize all of the attributes in the obvious
way, with two exceptions. When the word passed to the
constructor is null or has fewer
than MIN_WORD_LENGTH characters, the corresponding
attribute must be set to "DEFAULT". Similarly, when
the clue passed to the constructor
is null, or has no characters, or has more
than MAX_CLUE_LENGTH characters, the corresponding
attribute must be set to "DEFAULT CLUE".
All of the methods that return a hint must return
a String that contains nothing but uppercase
characters. (Hint: Look in the String class for a
method or methods that might be helpful.) On the other hand, the
getClue() and getWord() methods must return
the corresponding attribute "as is".
Each of the toString() methods must return
a String representation of the WordClue.
The version that is passed a boolean parameter
named verbose behaves differently depending on the
value of verbose. When verbose is false
the String it returns must consist of a single "line"
(terminated by a '\n' character) that contains
the word, followed by a dash (i.e., a '-'
character), followed by the clue.
For example, toString(false) for the WordClue
constructed from "madison" and "the university's namesake" must return
madison-the university's namesake\n.
On the other hand,
when verbose is true
the String it returns must consist of two "lines" (each
terminated by a '\n' character). The first "line" must
be the same as when verbose is false, and
the second "line" must contain the slices, with a space between each
pair. For example, toString(true) for the WordClue
constructed from "madison" and "the university's namesake" must return
madison-the university's namesake\nMAD IS ON\n.
Finally, the toString() method that has no parameters
must return the
verbose String representation.
The equals() method must return true when
the word attribute of the two WordClue
objects contain the same characters, ignoring their case.
(Hint: Look in the String class for a method or methods
that might be helpful.)
GameInfo class is an encapsulation of all of the information
needed to play a game, including the information provided by the
author of the game (stored in a WordClue[]) and the
calculated information (stored in a Slice[]).
The constructor must read the information (provided by the author of
the game) from the given file (using the FileUtilities
class), construct a WordClue object from each line, and
construct all of the Slice objects for all of the words.
The isComplete() method must return true
if the appropriate number of words/clues were read and must
return false otherwise.
The toString() method must return a String
that consists of multiple "lines" (each terminated with a
'\n' character) satisfying the following
specifications.
String
literal "Cluelist".NUMBER_OF_WORDS "lines" must contain
the terse String representations of the
WordClue objects.String
literal "Slices".String
representation of all of the slices.
For example, the toString() method must return the
following String for the game in net.txt
(where each "line" is on its own line).
Cluelist browser-it helps you surf the net bullock-The Net actress Sandra fault-result of serve into the net brooklyn-Nets home, in the NBA acrobat-performer with a safety net gross-net pay before withholdings imprecise-like one casting a wide net Slices BRO WS ER BUL LO CK FAU LT BR OO KL YN ACR OB AT GRO SS IMP REC ISE
You must submit a .zip file named pa5.zip
that contains GameInfo.java,
SevenLittleWords.java, Slice.java,
WordClue.java, and WordUtilities.java.
Your submission will be graded using the following criteria:
Slice: 10 pointsWordUtilities: 30 pointsWordClue: 20 pointsGameInfo: 20 pointsNote that the style criterion is mandatory for this assignment. This means that neither the correctness nor the quality of your code will be assessed if it does not conform to the style guide. Hence, if your code does not conform to the style guide you will receive a grade of 0 for Part B.
Note also that the correctness of some classes depends on the
correctness of the others (e.g., WordClue
uses WordUtilities and Slice,
GameInfo uses WordClue
and Slice). So, it is important that you get the
"foundational" classes working correctly.
Probably the best way to proceed is as follows.
Slice class.use(), reset() and
isUsed() methods.toString() method.WordUtilities class.slice() method in
the WordUtilities class on String
objects of length 3, 4, 6, 8, and 11.getClue(), and
getWord() methods of the WordClue
class.equals() method.equals() method.WordClue class.WordClue class.toString() method in
the WordClue class.toString() method in the
WordClue class.isComplete() method
of the GameInfo class.isComplete() method
of the GameInfo class.GameInfo class.GameInfo class.toString() method in the
GameInfo class.toString() method in the
GameInfo class.SevenLittleWords class.