Programming in Python, Fall 2009 (4 cr), Period I
Project
The project work is an obligatory part of the course.
Schedule
- Select your topic in the fourth exercises (28.9.-2.10.)
- In fifth exercises (5-9.10.), present the design of your project.
Explain in detail what you are going to implement. How will the interface look?
What modules and classes, etc you are going to have?
What libraries are needed?
Return this document (at most two pages) by email to the teacher of your group beforehand, and also take a printed copy of your document with you to the session.
- Possibly in sixth exercises (12-16.10.) some time may be reserved for guiding the project work.
- Deadline for the complete work is on Sunday 1st of November at 04.00 am (in the middle of the night).
Return your code, documentation, and test material in one zip or .tar.gz package via email to the teacher responsible for the topic:
- Markus Heinonen: Markov chain framework and grep replacement
- Harri Hämäläinen: Connect Four and Poker
- Lauri Alanko: Huffman coding and report generators
Note: The e-mail addresses appear to contain a sequence of hexadecimal digits when the link is traversed. These are spam prevention addresses which are regenerated daily. Each address is valid only for 3 days.
If returned late then at every starting hour two points will be reduced from your evaluated project points. So, if returned a minute late, two points will be reduced, and if returned after 2pm on Sunday, your project work will be rejected.
Total of 20 points are available for the project work. The points are further divided into the following categories: testing 5p, documentation 5p, implementation 10p.
Documentation
Write a separate file about the design and implementation issues, about tests done, and the instructions for the user of your program. Documentation category includes also the docstrings and comments in the source code.Report what changes to your program would be needed to make it work with Python version 3. You can use the utility 2to3 to help you.
More about documentation will be talked in later lectures.
Testing
Later lectures will also discuss the testing issues.Implementation
You should write clear and portable code, that runs on the Linux machines of the department. Reference platform will be melkki.cs.helsinki.fi. Note that you can still use Windows or Mac when developing. Just make sure it also runs on Linux. The version of Python is 2.5.You should respect this style guide when writing your code. If you choose to neglect some of those rules, a good reason for that should be given.
Topics
A topic with difficulty factor 1.2 is difficult, and a topic with 0.9 difficulty factor is relatively easy. Your project work is evaluated on the scale from 0 to 20, and the amount of points is then multiplied by the difficulty factor. Note that you still can't more than 20 points.
- Poker game using pyGTK or TkInter See Wikipedia (Difficulty factor 1.2) Program a straight or a draw poker game for one player that allows the possibility of doubling of your winnings.
- grep replacement See Wikipedia(Factor 0.9)
grep is a Unix utility that allows printing of all lines of a file
that match a given regular expression. The classic grep
doesn't allow all the regular expression patterns available in Python.
Program a replacement for grep in Python that allow these extensions.
Your program should include at least the following command line options:
-v -i -w -o -C
Use command "man grep" on melkki.cs.helsinki.fi machine to see explanation of those options.
- Markov chain framework See Wikipedia (Factor 1.1)
- Estimate a Markov chain from a Python sequence
- Produce a sequences when given an initial state and a transition matrix
- Find a stationary distribution(s) of a Markov chain, when it exists
- Compute the marginal distributions of a Markov chain
- etc
- Huffman coding See Wikipedia
(Factor 1.2)
Create a program that can compress and decompress files using Huffman coding. The program should work in the same way even when run on machines with different architectures (endianness issues)
- Connect Four See Wikipedia (Factor 1.0) Create a text mode game that works in two modes: either two players or one player against the computer with (simple) artificial intelligence.
-
Report generator / Beautifier (Factor 1.0) Create a report generating program that takes a text file, processes it, and produces nicely formatted html-pages with the same information plus possible summary or other aggregate information. The output should contain colors, lists, links, titles, and other usual html elements.
You can get an input for your program, for example, from the source code man pages. You can try man pages for bash or gcc, for instance. (These are found in the directory /usr/share/man/man1 at least on melkki.) In this case make from single man page several html pages that are linked and indexed to each other. Or if you have some other cryptic input text that you want to process, you may use that as well.
- Own topic
Use NumPy matrices to represent finite state Markov chain transitions. The frameworks should be able to do at least the following:
Jarkko Toivonen