.
.
.
```
This file describe an IFS.
One of the most well known would be the [Sierpinski Gasket](%%REPO_URL%%/2006/stewart/gasket):
```
3 0 0 1 1
.5 0 0 .5 0 0 .33
.5 0 0 .5 .5 0 .33
.5 0 0 .5 .25 .433 .34
```
or the [fern](%%REPO_URL%%/2006/stewart/fern):
```
4 -5.5 0 5.5 11
0 0 0 .16 0 0 .01
.85 .04 -.04 .85 0 1.6 .85
.2 -.26 .23 .22 0 1.6 .07
-.15 .28 .26 .24 0 .44 .07
```
etc...
Included in my submission will be a tarball of some IFS files,
including one that attempts (not very well) to mimic the IOCCC logo
(I figure it can't hurt to attempt to suck up, right?).
(**NOTE from Judges**: we extracted the files.)
I would try to explain how to create an IFS file but I am not smart
enough to condense it down to something that is coherent.
Basically the break down is:
`num` is the number of equations in the `IFS`.
`x` (min, max) and `y` (min, max) define the ranges that will be displayed
in the XBM image file.
The `a b c d e f` are used to iterative find points that lie in the IFS
from the algorithm
```
x = a * prevx + b * prevy + e;
y = c * prevx + d * prevy + f;
```
The `p` is for the probability that the equation will run.
### Obfuscations
The main obfuscation is using a `void *` as my only variable (aside from
the args for `main()`). This causes me to do much casting and pointer
arithmetic to get the correct location and completely does away with
any meaning the variables could have. This also makes the code more
convenient to read in the current form vs preprocessed. After
preprocessing there will be almost 300 casts in the code and I believe
they are all needed... (I would double check but my brain is kinda
mushy right now from chasing down a segfault in the code.)
The other main obfuscation being that it generates an `IFS`. Which isn't
all that common for a program to do. I mean google only has something
like 66,000 hits for "Iterated function system" so that means it is
obscure, right?
### Some other minor obfuscations
Since I formatted it as a "normal" program I did inject something that
on first glance will looks like a possible bug. (When you run it through
a C-beautifier this will be removed.)
I decided not to use `rand()` to generate a pseudo-random number. Instead
I use XOR and bit shifting.
The input file is used to make the program flexible and to allow it to
generate many different `IFS`s. This has the added bonus of hiding
information about the algorithm.
The use of many magic numbers. I figured if I get yelled about them in
a review they must be bad, right?
### Silly things
The use of decimal numbers where one would expect hex. Octal numbers
where one would expect decimal. Shifts instead of divides.
Using xbm as the output format. This might confuse someone who doesn't
have an X background. It happens to be easy but is probably a very bad
choice from a file size standpoint. 1024x1024 image is 641k in size.