LIFE3 V1.1 copywrite 1987 by Bob Benedict LIFE3 is a 3D version of the classic cellular-automaton game. A good reference is A K Dewdney's COMPUTER RECREATIONS column in Scientific American. 3D life has explored heavily by Carter Bays who will send you a 40 page document on it for $3 to cover costs. His address is Carter Bays Dept. of Computer Science University of South Carolina Columbia, S.C. 29028 This is a shareware program. If you find it useful please send $20 to: Bob Benedict 155 Barnes Dr Tallmadge, Ohio 44278 and I'll sent you a disk with the latest version, source and examples. 3D life is played on a 3D grid of cubic cells. Cells in this version have two states: alive or dead. Each suceeding generation is created by using a count of the live neighbors of a cell and a set of rules. If a cell is live and it has less than EL neighbors or more than EU neighbors it dies. Otherwise it continues to live. If a cell is dead and it has less than FL neighbors or greater than FU neighbors it continues to stay dead. Otherwise it comes to life. FL, FU, EL ,and EU are parameters that control the laws of the universe the cells live in. These may be adjusted by taking the "LAWS" pick from the "RUN" menu. Remember to hit RETURN after entering a value in a string gadget. Cells in this AMIGA version live in a finite 32x32x32 universe. The surface of this cube ( any coordinate 0 or 31) is sterile. The universe can be initially populated three ways: a file can be LOADed, the EDIT option can be used or the a region filled with the RANDOM option. The EDIT menu pick opens a 32x32 (x,y) window on a slice (z=constant) of the universe. The slider is used to pick the slice to edit. A mouse click will toggle a cell on or off. The edited universe is stored in the "seed" universe and used to compute new generations. The RANDOM menu pick clears the "seed" universe and then fills a rectangular region centered around the ORIGIN with the density of live cells that you choose. The actual number of cells set on is usually less than the density times the volume since a location may be chosen more than once. The random number generator uses the algorithm from Wichman and Hill's MARCH 87 BYTE article. The generators are seeded by the system clock each time RANDOM is chosen. You can also use RANDOM to clear the universe by setting the density to 0. The LOAD menu pick loads the seed universe from a file. The file also contains the law setting for that universe. The files used are straight ASCII text files that may be generated with a text editor or another program ( in case you don't trust my random number generators). The STORE menu pick stores the current seed universe ( usually NOT the universe displayed!!). The RESET menu pick stores the current universe in the "seed" universe. This lets you STORE that universe in a file. The ORIGIN menu pick sets the origin that is the center of the present view. The VIEW menu pick sets the location of your eye. You'r so interested in the origin that you always look directly at it. The view, origin and cells are all relative to a global right hand coordinate system ( y up, z out). To run the next generation just click with the select button in the window. To run many steps use the RUN menu pick. A mouse click will stop a multi- step run. The number of steps is bounded at 1000 to prevent strange behavior if you forget to hit return after entering a value in the string gadget. Algorithm A sparse matrix technique is used to create new generations. A universe has two representations: a 32x32 array of integers as a bit map and an array of structures that hold coordinates of live cells and some info used in rendering. Only cells adjacent to live cells are checked in generating a new universe. A spare bit map is used to keep track of cells checked so that no cell is checked twice. This cuts the amount of checking down by several orders of magnitude. A live cell has its bit set in the bitmap and is stored in the cell array. Its distance along the line from the eye to the origin is computed and the cells sorted in decreasing order. The cell list is clipped to remove cells behind the eye and the cells rendered with the most distant cells first. This approach works well for a large universe that is sparsely populated. One drawback is that the number of cells living can not exceed the size of the cells array. The present version uses arrays that hold up to 2000 cells. This program was written in MANX C. It has no assembly language routines. I'd like to thank Henry Shilling for his help with the C language and the cantankerous C compiler. Also thanks to Charlie Heath for the slick file requester. Next Step Possible improvement include using hires interlaced screens, adding animation, and speeding up the program with some assembler code. What would you like to see?