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.

U L E A
A O A P
F R O P
H V K T

U L E A
A O A P
F R O P
H V K T


Given the following grid of letters:

cel
khp
cow

Use your recursive algorithm to produce a list of all the legal combinations of letters beginning with the center (h). For example, your list should include the following (not necessarily in this order):

hce
hcel
hcelp
hcelpw
hcelpwo
hcelpwoc
hcelpwock
help

Create a .zip file containing all of your source code files required to produce the results described above and a file called words.txt containing the complete list of words generated by your recursive algorithm, as described above. Submit the words.txt as the report and the .zip file as the support file.

Recommended Answers

All 2 Replies

Correct me if I'm wrong, but it seems like you just posted an entire assignment, but didn't give any insight on how you've been trying to solve the problem - or even what the problem is. So we can only assume that you didn't actually attempt the assignment. I'd recommend coming back when you have ideas/attempts/something to share that shows you tried. Then I'd be glad to help you.

what do you mean, you need the logic to complete this? basically, the assignment contains the logic, so, there you go

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.