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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.:

  1. (50 points) The code.lsp program with all functions for encoding/decoding included.

  2. (20 points) Your example files:

  3. (30 points) The required answer.txt file where you answer the questions posed above.

  4. The optional problems.txt file. This file can help you if there are known problems with your program.

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.