home *** CD-ROM | disk | FTP | other *** search
-
- GarshneBlanker modules collection
- ---------------------------------
- volume I
- --------
-
- version 1.0 (Jan 24 1995)
-
- programs, sources and documentation are
- copyright 1995 Marzio De Biasi
- All Rights Reserved
-
-
- Demons blanker
- **************
- v1.0
- technical information
-
-
- Description
- -----------
-
- This blanker is a N-states cellular automata, which follow this
- simple rule:
-
- "at each generation, if a cell in state X is sourrounded by at least one
- cell in state X+1, then it will change its state to X+1"
-
- The blanker begins with a chaotic configuration of cells ("rubble" phase);
- the state of a cell is represented by its color.
-
- The first generations keep a chaotic aspect except for small "blobs" made
- of color waves.
- Whit time these blobs slowly grow and wrap up the chaotic cells ("drops"
- phase).
- Some generations after, the grid of cells has become a field of beautiful
- spirals that slowly expand themself; only a few chaotic spots survive:
- the DEMONS ("defects" phase).
-
-
-
-
- Garshneblanker preference window
- --------------------------------
-
- You can set the following parameters:
-
- Cells size : the size of the grid cells
- ----------
-
- Colors : number of colors to be used; fewer colors usually
- ------ means that the automata will reach the "defect" phase
- in fewer generations.
-
- Width : grid width
- _____
-
-
- Height : grid height
- ------
-
-
- NOTE: in order to obtain a fast refresh, you must use small values for Width
- and Height, but, if you are patient, try the highest resolution, set the
- cells size to 1, and wait for the last phase.
-
-
-
-
- Algorithm description
- ---------------------
-
- NC : screen colors (NC = 2 ^ Screen_depth)
- COLOR(x,y) : color of cell at (x,y)
- COLOR'(x,y) : next color of cell at (x,y)
- GRID_W : grid width
- GRID_H : grid height
-
- - for each generation do the following steps
-
- - for each cell at (i,j) do the following steps
-
- - c1 = COLOR((i + 1) mod GRID_W, j)
- - c2 = COLOR((i - 1) mod GRID_W, j)
- - c3 = COLOR(i, (j + 1) mod GRID_H)
- - c4 = COLOR(i, (j - 1) mod GRID_H)
- - if at least one among c1,c2,c3 and c4 equals (COLOR(i,j)+1) mod NC
- then COLOR'(i,j) = (COLOR(i,j) + 1) mod NC
- else COLOR'(i,j) = COLOR(i,j)
-
- - for each cell at (i,j) do the following steps
-
- - COLOR(i,j) = COLOR'(i,j)
- - redraw cell at (i,j)
-