18-Assignment-3-Boggle - CS106X Autumn 2010 Handout 18...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS106X Handout 18 Autumn 2010 October 6 th , 2010 Assignment 3: Boggle Thanks to Todd Feldman for the original idea behind the Boggle assignment. The Game of Boggle Those of you fortunate enough to have spent summers seeing the world from the back of the family station wagon with the 'rents and sibs may be familiar with Boggle, the little word game that travels so well, and those who didn't will soon become acquainted with this vocabulary-building favorite. The Boggle board is a 4x4 grid onto which you shake and randomly distribute 16 dice. These 6-sided dice have letters rather than numbers on the faces, creating a grid of letters from which you can form words. In the original version, the players all start together and write down all the words they can find by tracing by a path through adjoining letters. Two letters adjoin if they are next to each other horizontally, vertically, or diagonally. There are up to eight letters adjoining a cube. A letter can only be used once in the word. When time is called, duplicates are removed from the players' lists and the players receive points for their remaining words based on the word lengths. Solutions to Warm-up Problems Due: Wednesday, October 13 th at 5:00 p.m. Solution to Boggle Due: Friday, October 15 th at 5:00 p.m. This part of Assignment 3 is to write a program that plays a fun, graphical rendition of this little charmer, adapted to allow the human and machine to play one another. As you can see from the screen shot above, the computer basically trounces all over you, but it's fun to play anyway. The main focus of this part of the assignment is designing and implementing the recursive algorithms required to find and verify words that appear in the Boggle board. This problem is larger than either of the two problems appearing in Handout 19, so don’t be lulled into thinking it can be done in one sitting.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 How's this going to work? You will read the letter cubes in from a file and shake the cubes up and lay them out on the board graphically. The human player gets to go first (nothing like trying to give yourself the advantage). The player proceeds to enter, one at a time, each word that she finds. Your program is to verify that the word meets the minimum length requirement (which is 4), has not been guessed before, is a legal word in the English language, and can, in fact, be formed from the dice on the board. If so, the letters forming the word are highlighted, the word is added to the player's word list, and she is awarded points according to the word's length. The player indicates that she is done entering words by hitting a lone extra carriage return. At this point, the computer gets to take a turn. The computer player searches through the board looking for words that the player didn't find and award itself points for finding all of them. The computer typically beats the player mercilessly, but the player is free to try again, you should play as many games as you want before exiting. Each time you repeat
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

18-Assignment-3-Boggle - CS106X Autumn 2010 Handout 18...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online