CS101 Assignments


Assignment One (Due Feb 1, 2008)

To upload your written document and java codes to webCT, you should compress the files into a single file. Check this link out about how to zip files in Windows. In Mac, you can "tar" (means to-archive) your files by issuing the following command in a terminal: "tar -cvf myassignment.tar *" inside your homework directory (assuming that you put all and only your writen document and java codes in this directory). You can change myassignment.tar to other names you like. Then you can upload your .zip file or the .tar file to the webCT.


Assignment Two (Due Feb 14, 2008)

The skeleton codes for the clock and the solaris system can be download here: Second.java and EarthSimple.java. To compile the skeleton codes, you need to download StdDraw class StdDraw.java and put it in the same directory as the skeleton codes. When you compile the skeleton codes, just do "javac Second.java" or "javac EarthSimple.java". The system will automatically find the dependence. Apart from what we covered in the class, you can find some details about how to use StdDraw in the textbook at pages 141--146.

This assignment is due on Feb 14 midnight. We will overlap assignment three with assignment two. Assignment three is a small assignment that is a bit addon to assignment two. This arrangement is to make sure you have enough time to complete the project. More details will be discussed in class.


Assignment Three (Due Feb 18, 2008)

This is a mini assignment with a single question. This assignment is due on Feb 18 midnight. You do not have to write another document. Just submit the two Java files. Put some necessary comments in your program.


Assignment Four (Due Feb 29, 2008)

This is an assignment in which you will write some recursive functions. Question 3 is a bonus question. You do not have to complete question 3. If you give solution to question 3, bonus marks will be added to your final mark. This assignment is due on Feb 29 midnight. Just submit the Java files. Put some necessary comments in your program.


Assignment Five (Due April 4, 2008)

This is an assignment in which you will write programs usng arrays. Question 2 is a bonus question. You can just do question 1 to get all the marks. If you want to get the bonus marks, you do not have to write 2 versions for question 1 and 2. You can just do question 2 since question 1 is a speciail case of question 2.


Default Final Project (Due: May 11, 2008. Presentation: 9:00am, May 12, 2008)

Download the skeleton code Tetris.java and Tetromino.java and Draw class Draw.java and DrawListener DrawListener.java here.

A more flexible game programming sample code is sprite.tar.gz. It is the one that I showed in the previous class. It should be a good starting point for all kinds of games. The code is adapted from sample code in Killer Java Game Programming by Andrew Davison. Compile the code by "javac *.java". To execute the code, type "java MainFrame 90". 90 is the desired frame rate. It can be some other numbers.

If you want to use Draw for animations, keyboard and mouse inputs or make your buttons, here is the sample code drawdemos.tar.gz.


Modified on Feb 7, 2008