Assignments

Collaboration

We encourage you to work in groups, share ideas, and discuss possible solutions. However, you are individually responsible for writing up and submitting your answers, and for acknowledging with whom you worked. You should not be handing in identical files, duplicated among the members of your “team”.

Code Compatibility

Code should run in MIT Scheme or Dr Scheme, as used on the machines at Brandeis (if you use another interpreter, please be sure to check that it runs in MIT Scheme or Dr Scheme too—).

Completeness

You should always submit a complete file containing parseable Scheme code. In general, for full credit your solution must be loadable and runnable at the Scheme prompt. When the grader tests your homework, he will do so by typing (load "filename.scm"). If your code does not cleanly load, or crashes when running, please be sure to clearly state this fact when submitting your solution. Keep in mind that much later in the semester, as assignments become more difficult, we may be more lenient in this respect.

Please note that only plain text (ASCII) files are accepted. This in particular excludes Microsoft Word, Adobe PDF, DVI, or any other arbitrary (binary) format.

Lateness

(From the class Fact Sheet) Assignments handed in n days late (weekdays and holidays included will have nt/10 points subtracted from the grade, where t is the total point score for the assignment. The only exceptions will be genuine personal difficulties and medical emergencies, as judged by the teaching fellow.

Format

In most of the class assignments you will be given some code and then asked to improve upon it. You should adhere to the following:

  1. Keep the provided code completely unchanged at the top of the file. If you need to write a new version of a procedure, comment out the old version and leave it in its place, writing the new procedure in the "your code" area.
  2. Add your changes below the provided code. Add a comment that clearly distincts your code from the provided code.
  3. Provide the answers to the questions in order.
  4. Add your listings (example output; see below) immediately after your answer as a comment.

This gives the file the following format:

;;;this is the given code
...
((( Given Code )))
...
;;; HERE STARTS MY CODE
;;; Problem 1
((( My code for Problem 1)))

;; My listing for code 1

;;; Problem 2
((( My code for Problem 2)))

;; My listing for code 2

;;; Problem n
((( My code for Problem n)))

;; My listing for code n

Remember: If you're asked to re-define a procedure that you have been given, then as long as your procedure definition appears below the original procedure definition, Scheme will use your definition when the program is loaded.

The only exception from this format, will be Problem Set 3: “The Stability of Marriage”.

Documentation

All code submitted must have useful comments. Each procedure you write should be commented, either within the code, or above the procedure name. The length of your comments should be commensurate with the complexity of your solution. Any procedure submitted without comments will receive zero points. If, during grading, a piece of your code does not behave as it should, the TAs will be more lenient towards well written code accompanied by documentation that indicates that you understand how the function works.

Good Programming Practices:

In general you are expected to follow standard principles of good programming. For instance: your procedure names should be clear, and your solutions should be elegant.

Listings

Your solution to every problem should contain a listing -- proof that your modified code works. Since it is good programming practice to test everything you write, providing a listing should simply be a matter of cutting and pasting from your Scheme terminal to your editor. If your code “crashes”, and you haven't been able to resolve why, be sure to provide a listing of how it crashes in order to receive partial credit. Solutions submitted without listings will receive zero points.

In some cases you may edit your listing for the sake of brevity. In the case of the lunar lander, for instance, you may provide the first several and last several lines of a representative “game”.


Example Code:

Here is a snippet of Scheme code I wrote for an advanced AI class last year. Don't worry about understanding the code—the important thing to notice is that the code is well documented, and I have provided a listing of the output.

John's Code


Submission Proceedure

The problem sets typically consist of two parts

  1. Homework exercises: these should be written on paper and handed in in-class.
  2. Laboratory Assignment: these are the programming part which should be submitted electronically using Latte. Once in Latte, click on the assignments link, and then on the appropriate assignment. There will be a field where you can upload files on that page.