Goal

Checklist

  • You should use the following submit command: /u/cs126/bin/submit 2 readme mandtty.c mandps.c picture.ps. Do not use different file names. (Put each assignment in a different directory; that way you won't overwrite your old readme file.) Do not submit a.out.

  • In precept we will discuss the Mandelbrot set and arrays.

  • If you haven't done so already, please fill out the COS 126 student survey. It will only take a minute. You will receive a 0 for Assignment 2 (which cannot be made up) if this is not done by Wednesday, 2/17 11:59pm.

  • readme
  • name, precept number
  • description of problems encountered and high level description of code
  • output of mandtty.c with N = 32
  • array count values, formatted using "%3d "
  • print out approximation to Mandelbrot area - obviously don't use %3d since the area is not integral
  • describe how much and what help (if any) you received from the lab TA's - be specific
  • do not include PostScript code in any readme file!
  • mandtty.c
  • use fishtty.c as starting point - it plots a fish-like shape using the terminal window
  • update the variables r and s simultaneously, using the old values of r and s - otherwise, your plot will look like a "squished" Mandelbrot set
  • do not hardwire 32 into code - instead use #define N 32
  • common mistakes result in nothing printed - replace printf(" "); with printf("- "); for debugging
  • make sure your Mandelbrot set is not upside down or inverted
  • mandps.c
  • use fishps.c as starting point - it outputs a PostScript file which outputs a fish-like shape
  • be sure to rescale x and y coordinates appropriately, so that they are between 0 and 512
  • choose radius of circle appropriately to display nicely
  • use printf("%%"); to print a % sign
  • use a.out > picture.ps to redirect output into file picture.ps
  • view using gs picture.ps - this will not work from a telnet session
  • do not print any PostScript file unless it views properly with gs
  • experiment with a bigger value of N for more resolution, but if N is too big your output can easily grow to several gigabytes; be sure that your picture.ps file uses N = 32
  • picture.ps
  • the file you submit should have N = 32
  • under no circumstances should you ever submit or e-mail us any file exceeding 1MB
  • Other Sources

  • Fore more info and a guided tour of the Mandelbrot set check out this link or this one.
  • Check out the course Frequently Asked Questions link. Many common questions are addressed here.