Merge pull request #190 from xexyl/1992-imc

Formatting fixes in 1992/imc/README.md
This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-03-28 14:36:21 -07:00
commit c3fdc1b811
1 file changed
+43 -27
+43 -27
View File
@@ -1,4 +1,4 @@
$ Best Output: # Best Output:
Ian Collier Ian Collier
Oxford University Oxford University
@@ -12,24 +12,28 @@ $ Best Output:
make all make all
### To run ## To run:
## Judges' comments # text mode
./imc -text
The program is more interesting to run on workstations that can ./imc
make use of a Sun raster file. Others can make use of the -text
flag for character oriented output. ## Judges' comments:
The program is more interesting to run on workstations that can make use of a
Sun raster file. Others can make use of the -text flag for character oriented
output.
Of course, the source (layout) is self-documenting! :-) Of course, the source (layout) is self-documenting! :-)
NOTE: The original winning source assumed that NOTE: The original winning source assumed that exit returned a value which cause
exit returned a value which cause problems for some problems for some systems where exit returned a void. The file imc.c has been
systems where exit returned a void. The file imc.c modified to avoid this problem.
has been modified to avoid this problem.
## Author's comments ## Author's comments
Portability ### Portability
This program depends upon the ASCII character set, and makes certain This program depends upon the ASCII character set, and makes certain
assumptions about the architecture. It naughtily declares the first assumptions about the architecture. It naughtily declares the first
@@ -38,7 +42,7 @@ $ Best Output:
guess that makes this program OK on most flavours of unix, but not on guess that makes this program OK on most flavours of unix, but not on
PCs. PCs.
About the program ### About the program
This program has several parameters; each of them has a default, so the This program has several parameters; each of them has a default, so the
program runs happily without any parameters. If you supply an incorrect program runs happily without any parameters. If you supply an incorrect
@@ -46,12 +50,12 @@ $ Best Output:
run the program without knowing what it does, then supplying the single run the program without knowing what it does, then supplying the single
letter t as a parameter is a good move. Otherwise, direct the output letter t as a parameter is a good move. Otherwise, direct the output
into a file. The resulting file is most useful on Sun OS, where the into a file. The resulting file is most useful on Sun OS, where the
"file" command will tell you what to do with it. For best results with `file` command will tell you what to do with it. For best results with
the t option, you may want to change the definition of the I macro :-) the t option, you may want to change the definition of the I macro :-)
Details appear later, though the formatting of the code is a large clue. Details appear later, though the formatting of the code is a large clue.
All the code in this program appears between the ";" and ")" in All the code in this program appears between the `;` and `)` in
"for(;;)". That isn't because I want to win the best one-liner, but `for(;;)`. That isn't because I want to win the best one-liner, but
merely because it makes the code so much more impenetrable :-) In fact merely because it makes the code so much more impenetrable :-) In fact
running a pretty printer on the code hardly improves it at all. This running a pretty printer on the code hardly improves it at all. This
program has the obligatory macros with unmatched parentheses, and the program has the obligatory macros with unmatched parentheses, and the
@@ -64,7 +68,7 @@ $ Best Output:
their identities (and I think that using a variable called _ adds a nice their identities (and I think that using a variable called _ adds a nice
touch to the illegibility of the code). In this section of the code, the touch to the illegibility of the code). In this section of the code, the
data types of the numbers checked against is varied, and just because data types of the numbers checked against is varied, and just because
you see a ',' doesn't mean it has anything to do with commas! So I hope you see a `,` doesn't mean it has anything to do with commas! So I hope
you will agree that this program is more than a little obfuscated... you will agree that this program is more than a little obfuscated...
This is a Mandelbrot/Julia drawer. Normally it produces a monochrome This is a Mandelbrot/Julia drawer. Normally it produces a monochrome
@@ -82,20 +86,30 @@ $ Best Output:
ratio. ratio.
The options accepted by the program follow. Each option is a letter; it The options accepted by the program follow. Each option is a letter; it
may be preceded with a minus sign (or any character in [!-/]) and may be may be preceded with a minus sign (or any character in `[!-/]`) and may be
followed by other letters, so for example followed by other letters, so for example
m -m mask *mail m -m mask *mail
all mean the same thing. Most options may be followed by one or two all mean the same thing. Most options may be followed by one or two
numbers. These numbers may be separated from each other and from the numbers. These numbers may be separated from each other and from the
option by a space, or may be joined to each other with a comma, or may option by a space, or may be joined to each other with a comma, or may
be appended to the single-letter option, so be appended to the single-letter option, so
-s100,200 size 100,200 -size123 100 200 s100 200 -s100,200 size 100,200 -size123 100 200 s100 200
all mean the same (note that in "-size123" all characters following the
initial s are ignored). Numbers need not be specified, as each has a all mean the same (note that in `-size123` all characters following the
default value. In all cases except "j" and "t", and "s" whenever it initial `s` are ignored). Numbers need not be specified, as each has a
appears before "t", specifying an option without numbers has no effect. default value. In all cases except `j` and `t`, and `s` whenever it
(specifying "-s -t" has the effect of producing text with the default appears before `t`, specifying an option without numbers has no effect.
raster size; not a good idea!). The options are: (specifying `-s -t` has the effect of producing text with the default
raster size; not a good idea!).
### Options
The options of this program are:
-centre x y (float x,y) Centre the picture at x+iy in the complex -centre x y (float x,y) Centre the picture at x+iy in the complex
plane (default x=0 y=0) plane (default x=0 y=0)
@@ -113,7 +127,7 @@ $ Best Output:
The colour of each point is determined by taking the bit-and of the The colour of each point is determined by taking the bit-and of the
number of iterations and the mask. For a raster, the point is black number of iterations and the mask. For a raster, the point is black
(1-bit) if the result is zero, white otherwise. For text, the result of (1-bit) if the result is zero, white otherwise. For text, the result of
the operation determines the grey-ness of the character produced, with a the operation determines the greyness of the character produced, with a
blank for zero going up to a star for the maximum value. For a blank for zero going up to a star for the maximum value. For a
four-colour picture, for example, use a mask with two bits set (e.g. 3), four-colour picture, for example, use a mask with two bits set (e.g. 3),
and for a 16-colour picture use a mask with four bits set (e.g. 15). For and for a 16-colour picture use a mask with four bits set (e.g. 15). For
@@ -121,12 +135,14 @@ $ Best Output:
bits (e.g. 8). bits (e.g. 8).
While the program is creating your picture, it displays dots on the While the program is creating your picture, it displays dots on the
standard error to indicate its progess (one dot per pixel line). standard error to indicate its progress (one dot per pixel line).
### Example pictures to try
Here are a couple of good pictures to draw: Here are a couple of good pictures to draw:
imc -s 512,512 -f 600000 -l 512 -m 16 -c.00805,.74274 > screen1.ras ./imc -s 512,512 -f 600000 -l 512 -m 16 -c.00805,.74274 > screen1.ras
imc -s512,512 -j-.523,-.535 > screen2.ras ./imc -s512,512 -j-.523,-.535 > screen2.ras
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License: