CSC 161 Program #2"Wasp"Our second program is Wasp, a Word Search Puzzle generator.
|
LogisticsThis program is worth 8 points, or 8% of your final grade. The pertinent time coordinates:
Some of the fun, new stuff we'll cover includes:
|
||||||
DescriptionWasp will generate pseudo-random word search puzzles. These are the letter puzzles that have words embedded in a seemingly random square of characters.The input to Wasp will be a file describing a puzzle to be built:
The input file can be any format. Mine is just a text file containing one word per line, like this ( students.txt ). Your output will be an HTML file, so that we can see/play your Word Search puzzle using a web browser. Here's an example puzzle: ws1.htm Some issues:
A couple disclaimers:
|
||||||
Design RequirementsReq. #1 Use pointers - For this program, please use only pointers and pointer arithmetic to access arrays. Suggestion: go ahead and use the array brackets [], get things working, and then go back and replace the brackets using pointer arithmetic. Req. #2 Use inheritance - Make your Word Search class a subclass of a more general-purpose class dealing with letter-based puzzles. Such a superclass (mine is called LetterPuzzle) should also be applicable to something like a Crossword puzzle. Req. #3 Use enum - When placing words on your puzzle, you're probably going to need an (x, y) location and a direction for the word. I defined an "enum" called Direction with values of North, South, East, West, NorthEast, NorthWest, SouthEast, and SouthWest. Req. #4 Use friend functions - Define a friend function of your Word Search class, so that it can be printed using the output stream operator, <<. You can use this for debugging. Another nice debugging trick is to define the input stream operator, >>, so that you can read in puzzles while you're debugging.
|
||||||
GradingSame as program #1... your program will be graded on three areas:
thanks... yow, bill |
||||||
NotesApr 12, 2005 Random numbers are covered on page 136-137 of our text. You only have to call seed() once at the beginning of your program. Don't ask for a seed value. Try this:
2-D arrays are covered on page 516-524. Remember to eventually change those [] references to use pointers, eh. An example of using friend functions so that your class works with the stream operators (<< and >>) are on pages 707-713. Apr 14, 2005 Oops. Correction on seeding your random number generator:
Sorry... yow, bill One more thing.. it is apparent from grading Program #1 that you need a little more guidance in the testing area. So, for program #2, please include:
April 21, 2005 The requirement to write your puzzle in HTML format is dropped. You
can use the wasp_check program available in the common_area of the k:
drive to get HTML for your puzzle. |