forwarding a radium compilation fix.
[AROS-Contrib.git] / fish / mandel / mand4.c
blobe6b3f78458fd5f1c4ac1fa978cf322e811db7387
1 /*
2 MAND4.C - Information
3 Mandelbrot Self-Squared Dragon Generator
4 For the Commodore Amiga
5 Version 2.00
7 Accompanies MAND.C
9 Copyright (C) 1985, Robert S. French
10 Placed in the Public Domain
12 Assorted Goodies and Intuition-stuff by =RJ Mical= 1985
14 This program may be distributed free of charge as long as the above
15 notice is retained.
19 /* === IMPORTANT NOTE: =================================================
20 * If you are going to design Information pages, make sure that all
21 * lines are a maximum of 59 characters long. Also, make sure that
22 * there are 19 lines at most per page. These two restrictions
23 * combined comprise the reason why the info pages are (and should
24 * remain) terse.
25 * =====================================================================
29 #include "mand.h"
31 extern FILE *console;
34 void Information(SHORT page)
36 FILE *c;
38 c = console;
40 switch (page) {
42 case 0:
43 case 1:
44 fprintf(c, "Mandelbrot Self-Squared Dragon Generator Version %s\n", VERSION);
45 fputs("Copyright (C) 1985 - Robert S. French\n",c);
46 fputs("Extensively augmented (with Intuition!) by =RJ Mical= 1985\n",c);
47 fputs("Placed in the public domain\n",c);
48 fputs("\n",c);
49 fputs("Inspired by Scientific American, August/1985\n",c);
50 fputs("Corrections and improvements suggested by\n",c);
51 fputs("\"The Fractal Geometry of Nature\"\n",c);
52 fputs("By Benoit Mandelbrot, W.H. Freeman and Company, 1983\n",c);
53 fputs("(Used to be Z=Z^2+C, now is Z=Z^2-u, etc.)\n",c);
54 fputs("\n",c);
55 fputs("Robert S. French may be contacted at:\n",c);
56 fputs(" USPS: 2740 Frankfort Avenue\n",c);
57 fputs(" Louisville, Ky 40206\n",c);
58 fputs(" Phone: (502) 897-5096 ARPA: French#Robert%d@LLL-MFE\n",c);
59 fputs("=RJ Mical= may be contacted at:\n",c);
60 fputs(" Commodore-Amiga, Inc.\n",c);
61 fputs(" 983 University Avenue\n",c);
62 fputs(" Los Gatos, CA 95030\n",c);
63 break;
65 case 2:
66 fputs("The Mandelbrot set consists of pairs of numbers, one number\n",c);
67 fputs("real and the other complex. This set can be graphed using\n",c);
68 fputs("one axis for the real numbers and the other for the complex\n",c);
69 fputs("numbers. The Mandelbrot set is located on a graph roughly\n",c);
70 fputs("centered over the origin (0,0). The default settings of\n",c);
71 fputs("this program create a display that shows the entire set.\n",c);
72 fputs("All of the black display pixels represent Mandelbrot pairs.\n",c);
73 fputs("The shaded pixels show the pairs that are *almost* in the\n",c);
74 fputs("set. The pairs nearest the set on the display just miss\n",c);
75 fputs("making it into the set numerically; these are white. The\n",c);
76 fputs("more grey a position, the further the pair is from the set.\n",c);
77 fputs(" This program lets you explore the Mandelbrot set by\n",c);
78 fputs("panning across and zooming in to look at details of the set.\n",c);
79 fputs("You can also change colors and display mode. For instance:\n",c);
80 fputs(" : CS 1 ; Use the fancy arrangements of color set 1\n",c);
81 fputs(" : CO 29 ; Set the initial color offset\n",c);
82 fputs(" : CI 4 ; Set the color increment\n",c);
83 fputs(" : MC 29 ; Set the maximum tests count\n",c);
84 fputs(" : G ; Generate the picture\n",c);
85 break;
88 case 3:
89 fputs("The MC command lets you specify how many times each position\n",c);
90 fputs("is tested to see whether or not it's in the Mandelbrot set.\n",c);
91 fputs("A low MC value means that very few tests will be done on\n",c);
92 fputs("position, which will cause the display to be created more\n",c);
93 fputs("quickly, but which will also have a cruder approximation of\n",c);
94 fputs("the Mandelbrot set and, consequently, fewer colors.\n",c);
95 fputs("\n",c);
96 fputs("The MX and MY commands set the size of the display window.\n",c);
97 fputs("The larger your window, the longer it takes for the picture\n",c);
98 fputs("to be resolved. While you're experimenting with the\n",c);
99 fputs("program, you should create a smaller window with a lower\n",c);
100 fputs("count value until you get approximately the picture that you\n",c);
101 fputs("want to see. Then when you've gotten a picture you want to\n",c);
102 fputs("see in large scale, increase the size and count resolution\n",c);
103 fputs("to see the detailed version of your picture. For instance:\n",c);
104 fputs(" : MC 8 ; Each position will be tested only 8 times\n",c);
105 fputs(" : MX 80 ; The width is 25% of full width\n",c);
106 fputs(" : MY 50 ; The height is 25% of full height\n",c);
107 fputs(" : G ; Generate the picture\n",c);
108 break;
110 case 4:
111 fputs(" : CS 1 ; Color set 1 (special ranges of colors)\n",c);
112 fputs(" : CI 1 ; Color increment of 1 (smallest increment)\n",c);
113 fputs(" : MC 29 ; Count position and number of colors\n",c);
114 fputs("Then, by setting the initial color offset into color set 1 \n",c);
115 fputs("using the command CO, you can select from these ranges:\n",c);
116 fputs(" ====== ===========================================\n",c);
117 fputs(" 1-15 unit steps of blue\n",c);
118 fputs(" 16-30 unit steps of green\n",c);
119 fputs(" 31-45 unit steps of red\n",c);
120 fputs(" 46-60 unit steps of sky sky blue (blue and green)\n",c);
121 fputs(" 61-75 unit steps of purple (blue and red)\n",c);
122 fputs(" 76-90 unit steps of yellow (red and green)\n",c);
123 fputs(" 91-115 unit steps of white (all colors)\n",c);
124 fputs("CM is the command to set the display mode. Add up these:\n",c);
125 fputs(" o add 1 to get NO HOLD-AND-MODIFY\n",c);
126 fputs(" o add 2 to get INTERLACE\n",c);
127 fputs(" o add 4 to get HIRES (640 columns; low-res is 320)\n",c);
128 fputs("For instance, for HIRES and NO HOLD-AND-MODIFY, add 1 + 4:\n",c);
129 fputs(" : CM 5\n",c);
130 break;
132 case 5:
133 fputs("The starting (left) and ending (right) edge values for the\n",c);
134 fputs("axis of the real numbers (the horizontal axis) can be set\n",c);
135 fputs("using the commands SR (Start Real) and ER (End Real). For\n",c);
136 fputs("the complex numbers axis (vertical) the start (bottom) and\n",c);
137 fputs("end (top) edge values are set using SI and EI. Got it?\n",c);
138 fputs(" The graph that you get with this program's default\n",c);
139 fputs("values has the real numbers along the horizontal axis. The\n",c);
140 fputs("leftmost position represents the real number -2.85. The\n",c);
141 fputs("rightmost position represents 2.85. The complex numbers\n",c);
142 fputs("are charted along the vertical axis, starting at the bottom\n",c);
143 fputs("with a value of -2.05 and ranging up to 2.05 at the top.\n",c);
144 fputs(" You control the range of these axes using the text\n",c);
145 fputs("commands SR, ER, SI and EI. The commands ZR and ZI let you\n",c);
146 fputs("zoom in or out on the real and imaginary axes respectively.\n",c);
147 fputs("ZB lets you zoom on both proportionally.\n",c);
148 fputs(" Once the display is built, there are ZOOM menu commands\n",c);
149 fputs("which allow you to zoom in and out automatically. These\n",c);
150 fputs("are more convenient than using the text commands. On the\n",c);
151 fputs("other hand, the text commands lend precision.\n",c);
152 break;
154 case 6:
155 fputs("There's lots more to this program than what's described on\n",c);
156 fputs("these info pages. You should read the available text on\n",c);
157 fputs("Mandelbrot sets (see info page 1). This program has more \n",c);
158 fputs("features than what's described here. If you can get your\n",c);
159 fputs("hands on the source, you're welcome to expand these pages.\n",c);
160 fputs("In fact, this program is still far from complete. Care to\n",c);
161 fputs("have a bash at it? We need the greater-precision \n",c);
162 fputs("floating point. Also, we seriously need to be able to\n",c);
163 fputs("save some or all of the image to a disk file in IFF format.\n",c);
164 fputs("\n",c);
165 fputs("Good luck. Have fun! Send mail (on USENET at least!) if\n",c);
166 fputs("you find spectacular scenes.\n",c);
167 break;
170 default:
171 fputs("SORRY: there's not that many pages of info available!\n",c);
172 AvailableCommands();
173 break;
180 void AvailableCommands()
182 FILE *c;
184 c = console;
186 /* === TRY TO KEEP THIS PAGE 18 LINES TALL AT MOST ======================== */
187 fputs("AVAILABLE COMMANDS:\n",c);
188 fputs("SH - Show current settings G - Generate picture\n",c);
189 fputs("I n - Information pages Q - Quit\n",c);
190 fputs("\n",c);
191 fputs("SR n / SI n / ER n / EI n - Starting and ending coords\n",c);
192 fputs("MX n / MY n / MC n - Maximum x and y resolution and count\n",c);
193 fputs("XR n / XI n - Displace coord\n",c);
194 fputs("ZR n / ZI n / ZB n - Zoom around center point\n",c);
195 fputs("\n",c);
196 fputs("CM n - Graphics mode F n - Dragon function\n",c);
197 fputs("CI n - Color increment CD - Color divisor\n",c);
198 fputs("CO n - Color offset CS - Color set\n",c);
199 fputs("CT n - Color for points in set P n - Start from Preset\n",c);
200 fputs("\n",c);
201 fputs("D - Display picture A - Analyze\n",c);
202 fputs("SA filename - Save picture L name - Load picture\n",c);
203 fputs("< filename - Redirect input ; string - Comment\n",c);
204 fprintf(c,"MM n - Maximum number of %d pixel lines in memory\n",MAXX);