Use the more command to view the contents of a file.
This works on all of the supported operating systems (Unix, OS X, Windows).
If your system does not have the more command, try the
less command instead.
The input file begins with an integer n, followed by
four real values: xmin, ymin, width, and
height in this order. It is followed by a 256-by-3
table of real-valued color gradations. (There is no need to even read
in the last 768 values for the part of the assignment that deals
with the grayscale image.)
For example, the file
mand4.txt is:
4
-1.5
-1.0
2.0
2.0
0.000 0.000 0.734
0.000 0.300 0.734
. . .
0.000 0.000 0.000
If you use scanf() it won't matter whether the numbers are on
the same line or not.
|
Checking Your Work and Hints
|
There is a huge amount of information on the Web about
fractals, including a
Mandelbrot tutorial,
a
Mandelbrot applet,
and a
Mandelbrot generator.
Check out the
PostScript section
of the COS 126 FAQ List
for more information on PostScript
(although you shouldn't need much more info for this assignment).
It includes a link to download a PostScript viewer for
your PC or Mac.
Kevin Wayne