Lisp Programming Project
Programming Project 3
Reading and Decoding with Lisp
Due: Saturday November 6, 2004
Late Deadline (no penalty for late submission): Sunday November 7, 2004
NOTES: Any additional clarifications on the project will be posted
here if necessary.
Scenario
Lisp has higher order functions and these make things rather nice.
For instance, it becomes possible to write a general function
for encoding and decoding various formats. These formats can
be ciphers or even compression algorithms (huffman comes to mind).
In this project you are going to write a general function that
does this as well as a pair of functions for encoding/decoding
files.
Assignment
In this programming project, you will do the following:
- Write a lisp program that contains a function called
code. This function must take four arguments: an
input-file, an output-file, a function
for properly translating the input to the output, and
a key (if one is needed - it will be nil if one is not needed). Note that
this function may be an encoding or a decoding function.
- Write an encoding function that encodes text into a specific
code. The code you want to use is your choice. You may do
huffman coding, the caesar cipher, the vigenere cipher, etc.
Note that you will have to explain and offer examples of the code
you use. Your encoding function should be recursive where applicable.
-
Write an decoding function that decodes your encoded text into a specific
code. The code you use must be the same as for your encoding function
and you should use recursion where applicable.
- Write several input/output example files that show your code works.
Three or four should be sufficient as examples. There should be a
text file with a description of the examples and what they
demonstrate.
-
Write a text file explaining the code you used as well as how you
have implemented your program. This part should be done individually
for those who have partners.
- Write an optional file that contains any problems you had.
More Detailed Information about the Project
Since you are required to do file I/O you may want to check out
a sample program
that I have written to cat a file in a couple
of ways. You may want to do various web searches to find an appropriate
cipher or code.
Style
As usual, use comments and make your
files as readable as possible.
Start each file with comments containing your name(s) and account(s).
Note that comments in Lisp start with semi-colons.
Collaboration
You may work on this project with at most one other person.
Projects with more than two people working on them will receive
0 credit.
You should only submit work that is completely your own and
you should be able to explain your work to me.
Submission
For this
particular project there are 4 possible submissions.
Note that try will not be testing
or compiling your code, so it is up to you to make sure that your
code works prior to submission on the Sun system.
Code that does not compile will
not be looked at and you will receive a 0 for that part of
the project.:
- (50 points) The code.lsp program with all functions for
encoding/decoding included.
- try jdb-grd project3-1 code.lsp
- (20 points) Your example files:
- try jdb-grd project3-2 *.* description.txt
- (30 points) The required answer.txt file where you answer
the questions posed above.
- try jdb-grd project3-3 answer.txt
- The optional problems.txt file. This file can help you if
there are known problems with your program.
- try jdb-grd project3-4 problems.txt
You can resubmit
as often as you like before the deadline.
Projects that are not submitted before the late deadline will
not be looked at and will get a grade of 0.