Sixth Homework Part II - due 8 December (via ICON dropbox)

The second part should have your implementations of maze and webserver programs.

Sixth Homework Part I - due 2 December (via ICON dropbox)

Part II will be due 8 December (via ICON dropbox)

The sixth homework has two parts. The first part, due by Friday 2 December at 6pm, consists of documentation only. There are two programs, webserver.py and maze.py, which have some general documentation already in the form of docstrings (the long string that begins a program). The purpose of the first part of the homework is to prove that you can design a program before you actually write it. That is, you can think about how it will be organized in terms of functions, classes, objects, and variables, and write down your plans clearly. Some details of the code, which will be implemented in part II of this assignment, use techniques described in the current reading chapters: classes and objects, random selection, and GUI programming using Tk.

The Sixth Homework Part I is this:

  1. In webserver.py, write a docstring that describes, in English, how the overall program will be organized. In particular, explain what functions and methods it will have and what kind of data (in a file, and in variables) the program will use.
  2. Also in webserver.py, for each function you plan to define, say what will be its parameters and what it will return (if anything). Note that no function can have more than ten lines of code (comments and docstrings don't count as code). It would be good to write docstrings for each function, much as was done for you in Homework 5, where the code for the functions was missing, but the docstrings describing the functions were given to you. Now it's your turn to write some docstrings. Think of the docstrings as something a Python programmer (someone other than you) might read and know from the description, what function to write, what are its inputs, output, return value and type, and its behavior with respect to the webserver and the BaseHTTPServer and BaseHTTPRequestHandler class.
  3. In maze.py, write a docstring that describes, in English, no only how the program is organized (which is more complex because of how GUI programs work), but also says how you plan to represent the maze. Representation is an important part of software. Will a maze be a dictionary, a list, or some combination of these things? There will be a lecture explaining some techniques for this kind of problem.
  4. Also, in maze.py, you need to say what functions there will be, and even write the docstrings for the functions. These functions will likely depend on your representation of the maze, the position of the player in the maze, and perhaps information about GUI widgets on the window.
  5. In the attached Homework6.zip file, you'll find some preliminary docstrings for webserver.py and maze.py --- these are mainly constraints on doing the homework, what the program should do in terms of interaction either with a browser or user interaction. You should read and understand these first, before you start your own design.
  6. Homework6.zip -- this is what to download first; it's also what you will upload to the dropbox, after adding your comments and docstrings for Part I.

Scoring of the Sixth Homework Part I will depend on how thorough your documentation is. The maximum score the Sixth Homework is 120 points: 20 points for Part I and 100 points for Part II. Scoring for Part II will depend on accomplishing the minimum set of features (60 points), how well you carried out your plans for Part I (10 points), and how much interesting Python, and creative and additional features you added to the webserver and the maze (up to 30 points).

Help and Hints

Fifth Homework due 17 November (via ICON dropbox)

The fifth homework is due by 17 November (at 11:59pm), to be submitted electronically using ICON, under the "dropbox" feature which allows uploading of files. Instructions for the homework, including a starting folder (directory) can be obtained by downloading and extracting Homework5.zip -- it contains a README.txt file describing the homework assignment. The homework might take ten to twelve hours to finish, depending on your background. Once you have finished, prepare the compressed directory and upload to the dropbox. The directory name (folder name) should be Homework5 (no spaces between the "k" and "5"). There are two acceptable types of archived directory for this course, the "zip" format and the "tar.gz" format. Generally, there are many other possible formats, including "tar.bz", "rar"; we only accept assignments using the "zip" or "tar.gz" formats. Completing this homework requires some Python that reads files, draws and uses modules outside of the Python Standard Library.

Update 14 November: the Homework5.zip was changed to move makeStopWords() between the #----(start)-- and #---(end)-- within wordfreq.py.

Update 15 November: the Homework5.zip was changed in wordfreq.py only, to make the sort stable across multiple versions of Python2.7 (not the same on all machines in CS) and test cases changed accordingly. To get just the updated wordfreq.py file, download this: wordfreq.py

Fourth Homework due 2 November (via ICON dropbox)

The fourth homework is due by 2 November (at 11:59pm), to be submitted electronically using ICON, under the "dropbox" feature which allows uploading of files. Initially, because the homework might need further explanation, the dropbox has not been created (it will be created in a few days). Instructions for the homework, including a starting folder (directory) can be obtained by downloading and extracting Homework4.zip -- it contains a README.txt file describing the homework assignment. The homework might take four to six hours to finish, depending on your background (except the last problem, which is only 5 points, could take considerably more time). Six python scripts are in the Homework4 directory and need to be debugged, so that unit testing will give the proper response. Once you have finished, prepare the compressed directory and upload to the dropbox. The directory name (folder name) should be Homework4 (no spaces between the "k" and "4"). The directory should have six python scripts in it, as described in the README. There are two acceptable types of archived directory for this course, the "zip" format and the "tar.gz" format. Generally, there are many other possible formats, including "tar.bz", "rar"; we only accept assignments using the "zip" or "tar.gz" formats.

Notes:

Third Homework due 12 October (via ICON dropbox)

The third homework is due by 12 October (at 11:59pm), to be submitted electronically using ICON, under the "dropbox" feature which allows uploading of files. This due date comes two days following the midterm exam, however working on this homework will likely be helpful in preparing for the exam. Initially, because the homework might need further explanation, the dropbox has not been created (it will be created during the first week of October). Instructions for the homework, including a starting folder (directory) can be obtained by downloading and extracting Homework3.zip -- it contains a README.txt file describing the homework assignment. The homework might take four to six hours to finish, depending on your background. Six python scripts are in the Homework3 directory and need to be debugged, so that unit testing will give the proper response. Once you have finished, prepare the compressed directory and upload to the dropbox. The directory name (folder name) should be Homework3 (no spaces between the "k" and "3"). The directory should have six python scripts in it, as described in the README. There are two acceptable types of archived directory for this course, the "zip" format and the "tar.gz" format. Generally, there are many other possible formats, including "tar.bz", "rar"; we only accept assignments using the "zip" or "tar.gz" formats.

Notes:

Second Homework due 28 September (via ICON dropbox)

The second homework is due by 28 September (at 11:59pm), to be submitted electronically using ICON, under the "dropbox" feature which allows uploading of files. Instructions for the homework, including a starting folder (directory) can be obtained by downloading and extracting Homework2.zip -- it contains a README.txt file describing the homework assignment. The homework might take four to six hours to finish, depending on your background. Six python scripts are in the Homework2 directory and need to be debugged, so that unit testing will give the proper response. Once you have finished, prepare the compressed directory and upload to the dropbox. The directory name (folder name) should be Homework2 (no spaces between the "k" and "2"). The directory should have six python scripts in it, as described in the README. There are two acceptable types of archived directory for this course, the "zip" format and the "tar.gz" format. Generally, there are many other possible formats, including "tar.bz", "rar"; we only accept assignments using the "zip" or "tar.gz" formats.

First Homework due 15 September (via ICON dropbox)

The first homework is due by 15 September (at 11:59pm), to be submitted electronically using ICON, under the "dropbox" feature which allows uploading of files. Instructions for the homework, including a starting folder (directory) can be obtained by downloading and extracting Homework1.zip -- it contains a README.txt file describing the homework assignment. The homework is simple, but can be time-consuming to prepare. Upload to the dropbox an archived directory (other names for the same thing are "zipped folder", "tar file", "compressed archive"). The directory name (folder name) should be Homework1 (no spaces between the "k" and "1"). The directory should have a file in it, banner.py as described in the README. There are two acceptable types of archived directory for this course, the "zip" format and the "tar.gz" format. Generally, there are many other possible formats, including "bz", "rar"; we prefer that assignments only use the "zip" and "tar.gz" formats.

Homeworks (last edited 2014-05-25 18:29:53 by localhost)