ECE 538 Assignment 4

Your submission should include the usual source-code files, executable programs, and a document reporting your work in general and providing links to HTML code documents and validation tests.

Do the following exercises:

  1. Write a Python CGI script that reports the local (server) date and time in HTML format.

  2. Write a a Python image server to send a random image from a list of associated files - your choice of topic. See the Python program snowman.py.

    Look up the random module on the web. Here is an example of choosing random seasons:

    from random import choice
    
    seasons =  ["Summer", "Fall", "Winter", "Spring"]
    
    for i in range(1,10):
        print choice(seasons)
    

  3. Write a program to display the intersection of two line segments, (see the discussion of GM Seed and book software on the class CDROM). Input point coordinates from the command line. Draw the line segments on the screen and show the intersection point (if present). See examples below:

  4. Write a program, modeled after dsize, that searches a directory tree and deletes all empty folders. Demonstrate program operation of the directory structure in asgn_test.zip.

  5. Write a graphical Java application that shows a ball (circle) bouncing off the walls of a room with at least one oblique wall, perhaps like the one shown below. This application should function either as an application or as a applet.

  6. Write a program that calculates the change in velocity of a moving ball struck by a moving “paddle.” Devise a suitable class structure for a paddle object.

    Our eventual goal is to write a “Pong”, “BreakOut”, or video-based Pinball game.

    I found a reference to a Java Pong game. It does not seem to work properly, but maybe you can use it as a starting point.


Maintained by John Loomis, last updated 18 Feb 2008