



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The instructions for the final project of c sc 227 class in fall 2008. Students are required to develop a computer version of the word game boggle, following the rules and guidelines provided. The project consists of two iterations, with different requirements and deadlines.
Typology: Study Guides, Projects, Research
1 / 5
This page cannot be seen from the preview
Don't miss anything!




http://www.cs.arizona.edu/classes/cs227/fall08/projects/BoggleWords
Iteration 1
// Constructor takes a 2D array of characters that represents the // Boggle DiceTray with 16 dice already rolled in a known fixed state. public DiceTray (char[][] array)
// Return true if search is in the Boggle DiceTray according to Boggle rules. // Note: This method does NOT check to see if the word is in the list of words. public boolean stringFound (String search)
import static org.junit.Assert.*; import org.junit.Test; public class DiceTrayTest {
private char [][] tray = { {'A' 'B' 'C' 'D' } {'E' 'F' 'G' 'H' }, {'I' 'J' 'K' 'L' } {'M' 'N' 'O' 'P' } };
@Test public void testStringFindWhenThereStartingInUpperLeftCorner() { DiceTray dt = new DiceTray (tray); assertTrue (dt. stringFound ("ABC")); assertTrue (dt.stringFound("ABF")); assertTrue (dt.stringFound("ABC")); assertTrue (dt.stringFound("ABCD")); // ... assertTrue (dt.stringFound("ABFEJINM")); assertTrue (dt.stringFound("ABCDHGFEIJKLPONM")); assertTrue (dt.stringFound("ABCDHLPOKJNMIEFG")); }
@Test public void testStringFindWhenNotThere () { DiceTray dt = new DiceTray(tray); assertFalse (dt.stringFound("ACB")); assertFalse (dt.stringFound("AIE")); // ... }
@Test public void testStringFindWhenAttemptIsMadeToUseALetterTwice () { DiceTray dt = new DiceTray(tray); assertFalse (dt.stringFound("ABA")); assertFalse (dt.stringFound("ABB")); assertFalse (dt.stringFound("AEA")); // ... } }
Grading Criteria Iteraton 1 Due Tuesday 9-July: 50 pts
// Given the list of words entered by the user let methods getScore getWordsFound // getWordsIncorrect getWordsNotGuesssed all return the correct values. public void prepareResultsReport (List
// Score after the user quit. public int getScore ()
// All words the user entered that count for the score. public Set
// All words the user entered that do not count for the score. public Set
// All words the user could have guessed but didn't public Set
must be case in sensitive
duplicates only count as one
incorrect words have no point reduction
Grading Criteria Iteraton 2 Due Wednesday 10-July: 50 pts
Optional Run your code with BoggleGUI.java
http://www.cs.arizona.edu/classes/cs227/fall08/projects/BoggleGUI.java