For this lab, you are welcome to get technical help from another pair on how to use or install any of the tools involved. You may also get syntax help on C. You may not, however, get help on the algorithmic portion of the exercise outside of your partner, office hours, piazza questions to TAs or instructors.
This lab is broken down into several steps:You should have already created a hw3 directory and completed the pre-lab. This means everyone has a set of skeleton files that compile.
Meet up with your duet programming partner for today. Log on to adjacent computers and bring up your individual accounts.
You are being asked to write four functions. Go through all steps of the Duet Programming protocol for each function, trading roles each function. You can see the function descriptions in the prelab. Decide now who is going to be the first Strategist and who is going to be the first Implementer.
In this warmup, you are creating two types of image patterns - horizontal stripes and checker board. How are you going to verify they are correct? You could print them out and hand inspect them to see if they are what you expected.
Alternatively, you could print them in a format that is easy to see. In the file hw3_provided.c, with associated hw3_provided.h, I have written a number of functions for you. Two of them will be useful for your homework - reading and writing png files to and from arrays (provided_read_png & provided_write_png). The other is useful for both warmup3 and hw3 - write the image arrays as an html file. Then you can open it in an html browser easily. This only looks good for small images, so we are going to only work with small images in week3. We will restrict ourselves to 50x50 images. If you have not already done so, create files with those names in your directory, copy and paste the text, and svn add them to your repository.
You are not expected to write equality checkers for your image test cases. Instead, you should print out the result to an html file so you can check it visually. This is how we will test your code. The Strategist will write these tests.
Make sure you add everything to the compile line of your Makefile. Specifically, in order to compile your completed warmup, you'll need warmup3.c, warmup3_main.c, and hw3_provided.c. To use the provided functions for reading/writing PNGs:
clang -c -Wall -o hw3_provided.o hw3_provided.c
To link this function correctly using the png library with your own solutions, we add the -lpng flag to clang:
clang -Wall -lpng -o hw3 hw3_provided.o warmup3.c warmup2_main.c
$ svn commit -m "hw3 warmup complete"