Boggle- Final Project - Program Design and Development | C SC 227, Study Guides, Projects, Research of Computer Science

Material Type: Project; Class: Full Course Title: Program Design and Development; Subject: COMPUTER SCIENCE; University: University of Arizona; Term: Spring 2000;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 09/17/2009

koofers-user-jkc
koofers-user-jkc 🇺🇸

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
C Sc 227: Boggle
Collaboration This final project must be completed alone
Due Dates:
Required Iteration 1: Tuesday 5-May 8:00pm (100pts)
Optional Iteration 2: Wednesday 6-May 5:00pm (100pts)
o This will replace your lowest project score, assuming this score is larger
For this project you are asked to complete part or optionally all of a computer version of Boggle.
Boggle the Game
Boggle is a word game designed by Allan Turoff and
trademarked by Parker Brothers and Hasbro. The game
of Boggle has a container that holds 16 dice that can be
"rolled". Each six-sided die has letters from which players
try to find words. Words are possible if letters line up next
to each other horizontally vertically or diagonally without
being reused. There are 3 letters that can be connected to
any letter on a corner 5 for the other six letters on the
borders and 8 for the middle four letters (there is no
wraparound). To make up one word no letter may be used
more than once (this include the "Qu”). A word is accepted
and the score increased if all of the following are true:
The word made up from the dice follows the letter connection rules of Boggle
The word exists in our official list of words: BoggleWords
http://www.cs.arizona.edu/classes/cs227/spring09/projects/BoggleWords
The word contains 3 to 16 characters (one and two letter words are not allowed)
The word is not already in the accepted list (no duplicate words allowed)
The player's score is determined by summing the points for all words found in a dictionary according
to these Boggle rules.
Word Length Points
3 1
4 1
5 2
6 3
7 5
8+ 11
Simulate Boggle's dice rolls with the 16 dice. The same die must not always appear in the same
location. Here are the letters of each of the 16 six-sided dice where each:
L R Y T T E V T H R W E E G H W N E S E O T I S
A N A E E G I D S Y T T O A T T O W M T O I C U
A F P K F S X L D E R I H C P O A S E N S I E U
Y L D E V R Z N R N H L N M I H U Qu O B B A O J
Iteration 1 : Required of all
As with other projects you are asked to first develop a well-tested model. To get started immediately
begin with a type named DiceTray that determines if a given String can be found in the collection of
the current dice values using the rules of Boggle. DiceTray must have these 2 methods:
pf3
pf4
pf5

Partial preview of the text

Download Boggle- Final Project - Program Design and Development | C SC 227 and more Study Guides, Projects, Research Computer Science in PDF only on Docsity!

C Sc 227: Boggle

Collaboration This final project must be completed alone

Due Dates:

Required Iteration 1: Tuesday 5-May 8:00pm (100pts)

Optional Iteration 2: Wednesday 6-May 5:00pm (100pts)

o This will replace your lowest project score, assuming this score is larger

For this project you are asked to complete part or optionally all of a computer version of Boggle.

Boggle the Game

Boggle is a word game designed by Allan Turoff and

trademarked by Parker Brothers and Hasbro. The game

of Boggle has a container that holds 16 dice that can be

"rolled". Each six-sided die has letters from which players

try to find words. Words are possible if letters line up next

to each other horizontally vertically or diagonally without

being reused. There are 3 letters that can be connected to

any letter on a corner 5 for the other six letters on the

borders and 8 for the middle four letters (there is no

wraparound). To make up one word no letter may be used

more than once (this include the "Qu”). A word is accepted

and the score increased if all of the following are true:

 The word made up from the dice follows the letter connection rules of Boggle

 The word exists in our official list of words: BoggleWords

http://www.cs.arizona.edu/classes/cs227/spring09/projects/BoggleWords

 The word contains 3 to 16 characters (one and two letter words are not allowed)

 The word is not already in the accepted list (no duplicate words allowed)

The player's score is determined by summing the points for all words found in a dictionary according

to these Boggle rules.

Word Length Points

Simulate Boggle's dice rolls with the 16 dice. The same die must not always appear in the same

location. Here are the letters of each of the 16 six-sided dice where each:

L R Y T T E V T H R W E E G H W N E S E O T I S

A N A E E G I D S Y T T O A T T O W M T O I C U

A F P K F S X L D E R I H C P O A S E N S I E U

Y L D E V R Z N R N H L N M I H U Qu O B B A O J

Iteration 1 : Required of all

As with other projects you are asked to first develop a well-tested model. To get started immediately

begin with a type named DiceTray that determines if a given String can be found in the collection of

the current dice values using the rules of Boggle. DiceTray must have these 2 methods:

public class DiceTray {

// 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) { // TODO : Complete this method }

// 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) { // TODO : Complete this method return false ; } }

Here is a start of a unit test java that asserts some strings can be found that begins in the upper left

corner. After you get these working you can change stringFound to try to find a word beginning at

any of the 16 locations.

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 5-May 8:00 pm

____/ +100 For DiceTray(char[][]) and stringFound(String) Graded by WebCat

// Return the dicetray as a string. public String getDiceTrayAsString() { return dicetray.toString(); }

// Given the list of words entered by the user let methods getScore() getWordsFound() // getWordsIncorrect() getWordsNotGuesssed() all return the correct values. public void prepareReport(List) { // TODO : Complete this method }

// The score after the user quit. public int getScore() { // TODO : Complete this method }

// All words the user entered that count for the score. public Set getWordsFound() { // TODO : Complete this method }

// All words the user entered that do not count for the score. public Set getWordsIncorrect() { // TODO : Complete this method }

// All words the user could have guessed but didn't public Set getWordsNotGuessed() { // TODO : Complete this method }

Your Computer Version of Boggle

One version of Boggle will be console based with console IO using Scanner. By using the given

design (set of methods) you will also be able to use the GUI provided by Rick for an event driven

version that has a timer. After the user decides to quit show all words guessed correctly and the

score. Also show all words not guessed that are in BoggleWords and the current "dice". These are

the words the user did not find (and there are usually many). Your output should appear like this:

Play one game of Boggle:

H A H I

V W O S

E E S E

T I P W

Enter words or ZZ to quit:

tip tips spit see how sHoW notInTheBoard

tie tee tees shows spite

have have have

shave shaves

Aardvark ZymUrgy zZ

Score: 19

You found these words correctly:

have how see shave shaves show shows spit spite tee

must be case in sensitive

duplicates only count as one

incorrect words have no point reduction

show 10 per line max

tees tie tip tips

Word you tried that were incorrect:

aardvark notinttheboard zymurgy

Total number of word you could have listed: 68

awe awes epee eve eves ewe ewes hah haves haw

haws his hiss hoe hoes hos hose hoses hows ohs

owe owes pee peso pesos pet pew pews pie pies

pis pit psi set sew sews shah shoe shoes

sieve sip sit site sos sow sows spew ssh sweep

sweet ties tis veep veeps vet wave waves wee weep

weeps wees wet who whoa whose woe woes

The above dialog indicates you must show the dice tray and ask the user to enter words found in the

dice tray. When the user enters ZZ ((or zZ or Zz or zz) show the following information

1. The score

2. All words the user found in the dice tray that are also in our list of words (BoggleWords)

3. All incorrect words the user entered that were either not in the board or not in the list of words

4. All words the user missed

Grading Criteria Iteraton 2 due Wednesday 5-May @ 5:00 pm

____/ +80 WebCat turnin: Correctness and CodeCoverage

____/ + 2 0 Console Based Game produces output like that above emailed to your grader for this consoe game,

who is the section leader of the person with the alphabetically fisrt last name. No need to send the

DiceTray or Boggle classes as long as you have good WebCat scores for both.

We will use our own solution

show 10 per line max