The following is a checklist which provides a summary of the
assignment. This is meant only as a supplement; please read the original assignment
description.
Frequently Asked Questions:
(This is the only part of this checklist which will change during the
week.)
[Michael 3/4] Yes, /usr/dict/words actually has numbers in it, some
punctuation and lots of uppercase letters. So to make things easier,
if you want a cleaned up version, you may feel free to use the file
/u/cs226/prog4_files/words when testing your program.
[Michael 3/3] I have told several students that you may assume that
the wordlist in the input comes in alphabetical order. So you may
rely on this if you wish. (of course, to run your program on an
unsorted list, you may use the unix sort command as part of
the command line argument)
[Michael 3/3] And here is an interesting
20-by-20 puzzle I found.
[Amal 3/3] Here's a
30-by-30 puzzle.
[Michael 2/27] If you would like, you may assume that both the puzzle
and the list of words are all lowercase, and only consist of letters.
Of course some have noticed that this is NOT true for the
/usr/dict/words file (but can be fixed using tr.
[Michael 2/27] Oops. The sample puzzle given below was 9x9 (not 8x8).
I have gone ahead and fixed the first line to reflect this change.
Overview:
The original assignment description is quite detailed, so this will be
a short checklist this week. The details of the assignment are given
there, and the Hints section even gives some suggestions for
making progress.
Input Format: As stated, your program should
expect to read an integer N from the command line, followed by N lines
of N characters each with characters separated by whitespace, followed
finally by a list of words for which to search. For example, a
complete inputfile, which could be used as cat inputfile |
a.out is given here. Alternatively, you
could combine a plain puzzlefile such as the
example given in the assignment, with a
different list of words, for instance with the command line:
(echo "9"; cat mysquare; cat /usr/dict/words) | a.out
You should only consider words that are 4-letters or longer -
ignore any others that are in the dictionary.
Output Format: Simply output all the words
which are contained somewhere in the puzzle. You may output them in
any order, however it would be nice if you make sure to only print out
a particular word once (even if it appears in several places in the
puzzle). If you want, you could also choose to describe the location
in the puzzle where each successful word lies -- its up to you.
readme: Make sure you explain what
you do and why. Give estimates of the time/space costs which might be
required, and any limitation you place on N or the dictionary size.
Enjoy...
cos226 Class Page
wass@cs.princeton.edu
Last modified: March 3, 1999