Programming Assignment #3

If you pair-program, put both names in comments at the start of all your code files. Pair programming means all work done together!

Your Interactive Graphics Project, part deux

It's strongly recommended you make a backup copy of your current code, just in case you make a real mess of it in this assignment and need to step back.

Add more shapes to your picture in GAME/main.c -- a lot more. Use loops and random numbers to draw a random number of at least one shape in random places (within reason). For example, draw birds in the sky or stars, or cows in a field, or cars on a highway. Whatever makes sense for your picture.

Make sure that your program draws a different picture each time you run it.

myDisplay() is called repeatedly and frequently, but you want to call your random picture drawing code once. One way to make this happen is to use a static variable to keep track of whether myDisplay() is being called for the first time or not. Static variables are not that commonly needed in basic programs. The book talks about them in Appendix J. Just follow the example given in rand_rect.c, and you should be OK. As soon as you learn how to use arrays, you won't need a static variable.

What to submit

If all your code is still in just one main.c file, submit that. Otherwise make a Zip file with just these files and folders:

MacOS X Xcode users: The clean operation in Xcode still leaves an awful lot of junk. If you have a Zip utility that lets you edit Zip archives, please use it to get rid of the build and MACOS specific files. If you don't, then please make a folder called GAME somewhere and copy the relevant files to it, then compress just that folder.

Email with the Subject line: EECS 110: PA3.


Valid HTML 4.01 Strict