CS2851 -- Lab 4: Wordsearch

Winter 2005-2006
Objectives Addressed
Overview

In this lab, you will write a program to find all the words in a dictionary that can be spelled by combining adjacent letters in a grid of letters.

Procedure

You are required to design, implement, and test a program that will will read in a file consisting of a grid of letters and write a file containing all possible combinations of adjacent letters that spell words in a dictionary. Words with fewer than three characters should not be considered. Two example files are cs2851L4a.txt and cs2851L4b.txt. Your program should store all of the words from the dictionary in a JFC container that implements the Set interface.

In addition, your program should produce an output file that contains all of the words found in grid of letters. Although it is not required, you may wish to create a graphical user interface for your program. You may even wish to create an interface to simulate a popular board game and generate your own random grids.

The green text in the following grid demonstrates legal letter combinations for LOOT, APE, and ROPE, but the letters that formed ROPE may not be used to form PORE since R and E are not adjacent to one another.

ULEA
AOAP
FROP
HVKT

ULEA
AOAP
FROP
HVKT
Interim Deliverables (One hour before week 7 lab begins)

You must demonstrate your recursive algorithm on a 3 by 3 grid of letters (starting at the center letter only). For the demonstration, you will be given a 3 by 3 grid of nine letters that you may enter into your program however you wish. Your program should produce a list of all combinations of letters (at least three characters long).

Note: This demonstration will be worth 40% of your grade for this assignment.

In addition, you should indicate how much time you spend on this assignment in the FAST system. You are encouraged to log your activity as you work on the project. At a minimum, you should log all of the time spent during the first week (logged for week 6) before the due date given above.

Lab report (due 11:00pm, the day prior to week 8 lab)

Here is a template file to use as a starting point for this report.

Your report should include:

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost.

If you have any questions, consult your instructor.

Acknowledgment

This assignment was originally developed by Dr. Chris Taylor.

Last Updated: Friday, 20-Jan-2006 09:27:23 CST