COMP 144 Programming Language Concepts
Spring 2004


Assignment: First ML Program

Due Date: Wed March 3


Description

Your task in this assignment will be to write an ML program that computes the Mandelbrot set as you have done in Java and Perl. You will not be drawing a picture of it. Instead you will be doing what you did in the second Perl script, where you computed membership information and created a 2D array containing integers representing color values for each pixel in an image.

For ease of viewing the output lets have this thing compute a 30 x 30 pixel image.

Input is a pain in ML, so you can if you like have your program run from a,b,c,d values set in the initial parts of the code. Or, you can figure out the input functions and parse some parameters for extra credit.

Output is not so bad, so let's write the integer array to a file called "image.txt" Write the first line having 2 integers (height, width) so some other filter (like a Perl program perhaps) can know the array size, and then read your ML output and draw the image. Each subsequent line will be a row of the image data you have computed. Make a blank space between integers.

You can also do this in Unix by writing to stdout ("print") and using IO redirection.

In either case, the problem is converting integers into the strings you have to give to "output" or "print".


Submission

This assignment is due March 3 (during the first ten minutes of class). Late assignments get 25% off each day they are late. Your submission will be electronic. Your electronic submission will be an e-mail sent to wluebke@cs.unc.edu with the subject

COMP 144 Assignment ML-1 Submission

and a single .zip file attached to it. This file should have the following content:


Grading

I will grade both the quality of the source code (design and documentation) and the output. I will not grade programs that do not compile. Collaboration is encouraged, but you cannot share source code. Honor Code applies to this program. Please, read http://www.cs.unc.edu/Admin/Courses/HonorCode.html for more details.