Game of Life Screen Saver v1.1
by Chris Studholme (c) 1998
==============================

This screen saver represents an implementation of Conway's Game of Life.  
A brief description, not written by me, of the game is given here:

  Cellular Automata, of which Life is an example, were suggested by
  Stanislaw Ulam in the 1940s, and first formalized by von Neumann.
  Conway's "Game of Life" was popularized in Martin Gardner's
  mathematical games column in the October 1970 and February 1971 issues
  of Scientific American.  (Shorter notes on life are also given in the
  column in each month from October 1970 to April 1971, and well as
  November 1971, January 1972, and December 1972.) There's also quite a
  bit on the game in "The Recursive Universe", by William Poundstone,
  Oxford University Press, 1987, 252 pages.

  The rules for the game of life are quite simple. The game board is a
  rectangular cell array, with each cell either empty or filled. At each
  tick of the clock, we generate the next generation by the following rules:

        if a cell is empty, fill it if 3 of its neighbors are filled
        (otherwise leave it empty)

        if a cell is filled, it
                dies of loneliness if it has 1 or fewer neighbors
                continues to live if it has 2 or 3 neighbors
                dies of overcrowding if it has more than 3 neighbors

  Conway has demonstrated that it is possible to construct the basic
  building blocks of a computer from Life using modified glider guns.
  See the last chapter of
     Elwyn R. Berlekamp, John H. Conway, and Richard K. Guy, "Winning
     Ways", Academic Press, New York, 1982, ISBN 0-120911-507.
  for details.


This readme file contains the following sections:

- System Requirements
- What's New
- Random Numbers
- Installation and Usage
- Undocumented Features
- Registry
- Known Bugs
- Legal Stuff


SYSTEM REQUIREMENTS
-------------------
This screen saver requires your computer to be:

  - at least a 486
  - running Windows 95 or Windows NT

That is all.  This software makes very minimal use of RAM and hard disk space, 
and thus, minimum requirements in these areas are not specified.  

This screen saver is a Win32 program written using C++, with all time critical 
methods hand coded in 32-bit machine language.  The machine language coded 
methods make use of one 486 only instruction (hence the requirement above) and 
have been hand optimized for the Pentium instruction pipeline.  A result of 
this coding practice is that this screen saver should give acceptable 
performance on any speed of machine.  


WHAT'S NEW
----------
The only change in version 1.1 is that the Game of Life engine is significantly
faster.  Up to 30% faster is some cases.


RANDOM NUMBERS
--------------
Before going any further, I would like to say something here about the way in 
which random numbers are generated by this screen saver.  

The Game of Life screen saver makes use of a combined linear congruential 
generator as its pseudo-random number generator.  The chosen generator has a 
period of 2^62 which is represented by a 64 bit internal state.  Random 
numbers are carried from one instance of the screen saver to another via the 
registry (see the Registry section later in this document for more details).  
At each instanciation of the screen saver, a random seed is acquired by 
combining bits from the registry with the current value of the system timer.  

As the screen saver is being executed, addition truly random bits are acquired 
at a rate of approximately two bits per second and combined into the state of 
the pseudo-random number generator.  These, so called, truly random bits are 
acquired by examining the parity of the value of the system timer at an 
interval that is given as some number of iterations of the game.  The number 
of iterations between random bit generations is chosen such that one random 
bit is generated every half second or so.  This method of truly random bit 
infusion is not guaranteed to yield truly random bits of any specified 
quality, but does ensure that the Game of Life will always proceed in a non-
deterministic manner and will never cease to surprise and amaze the viewer.  

Random numbers are used by the Game of Life for two purposes.  The first is to 
initialize the world (or game board) on which the game will be played.  It can 
be safely said that there are only 62 bits of entropy in this initial world.  
If the game is left to be played without perturbation, these initial 62 bits 
of entropy will dictate the remainder of the game; however, if world mutations 
are enabled (see the Usage section below), then random mutations of the world 
will occur at a specified interval.  Since the state of the random number 
generator changes in a truly random manner during the course of the game, it 
can be assumed that there is a truly random component to the random mutations, 
and therefore, after the mutations have begun, it can no longer be said that 
the world has only 62 bits of entropy.  


INSTALLATION AND USAGE
----------------------
To install the Game of Life screen saver, simply copy the file LIFE.SCR to 
your Windows SYSTEM directory (SYSTEM32 for Windows NT) and then select the 
Game of Life screen saver as your active screen saver.  If you are using 
Windows 95, you may find that the screen saver appears as just "Life" in the 
screen saver dialog.  If this is the case, and you don't like it, you should 
rename the file LIFE.SCR to "Game Of Life.scr" (without the quotes).  If you 
are using Windows NT, you don't have to worry about this.

The Game of Life screen saver has a variety of settings that may be adjusted 
by the user.  These settings are documented below.

- WORLD SIZE
	The world size dictates the size of the world on which the game will be     
played.  If the world size is set to full, a world equal to the size of     
your screen is used.  If Half or Quarter size is selected, then the     
world will have dimensions that are half or a quarter, respectively, of 
your screens dimensions.

- ZOOM FACTOR
	If your world size is less than the size of the whole screen, you may 
zoom the world such that it fills more, or all, of your screen.  If your 
world size is half the screen dimensions, you may zoom by 2, or if your 
world is a quarter the screen dimensions, you may zoom by either 2 or 4.  

- TILE WORLD
	If your world size is less than the size of the whole screen, and you do     
not zoom the world to fill the whole screen, you may instead tile the 
world such that it occupies the entire screen.  

- INITIALIZATION SIZE
	This option allows you to choose how much of the world you wish to have     
initialized with random bits.  You may choose to initialize all of the     
world, half of the world, or a quarter of the world.  These ratios are of     
the world's dimensions, not area.  They correspond to areas that are all 
of, 1/4, or 1/16th of the total area, respectively.

- WORLD MUTATION RATE
	The Game of Life is a completely deterministic game.  Once the initial 
conditions have been chosen, the game will proceed in a way that is 
entirely predictable.  Typically, the game will eventually reach a steady 
state at which time the world is occupied entirely by either static 
objects, or objects with some sort of repetitive behaviour.  This 
repetitive behaviour usually has a period of two, that is, the object 
alternates between two difference states.  For a screen saver, this 
steady state situation can be very boring and also defeats the purpose of 
a screen saver (to prevent phosphor burn).  To circumvent this 
difficulty, the concept of world mutations was implemented.  A world 
mutation occurs when a single pixel in the world is chosen at random, and 
then toggled (if it is on, it is turned off, or vice verse).  A variety 
of rates of world mutations can be chosen.

- ONLY AT STEADY STATE
	As mentioned above, a steady state situation occurs when the world 
settles down into some periodic behaviour.  This screen saver defines 
steady state as being a state of periodic behaviour with period two.  
When this Only at Steady State flag is checked, world mutations will only 
occur when the world reaches a steady state with period two.  As long as 
the world is not in a period state, or if the period state has period 
greater than two, world mutations will not occur.  If this flag is 
unchecked, world mutations occur continuously at the interval specified 
by the World Mutation Rate settings above.  

- SHOW MUTATIONS
	If this option is checked, world mutations can be seen as the pixels are 
toggled.  The world mutations are most noticeable in the empty (black) 
space, where the toggled pixels appear, then immediately disappear. 

- PIXEL COLOR
	This button opens a dialog box that allows you to choose the color of     
the pixels on the world.  


UNDOCUMENTED FEATURES
---------------------
What a silly section heading.  If I discuss any features here, they will cease 
to be undocumented features.  The most obscure feature of this screen saver is 
a world dump feature.  If you cancel the screen saver by pressing the 's' key 
on the keyboard, a file named LifeDump.bmp will be created in your Windows 
directory.  This bitmap file will contain a monochrome image of the state of 
the screen saver immediately before you canceled the screen saver.  If you 
find that your screen saver is doing something really neat when you go to 
cancel it, hitting the 's' key will save a static image of what was happening.  
This can be really useful when you find periodic behaviour with period greater 
than two and want to study it further.  


REGISTRY
--------
All of the persistent settings used by this screen saver are stored in the 
registry under the path

  HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\
    Screen Savers\Game of Life

There is no need to manually edit any of these settings as all of them are 
available through the settings dialog box.  


KNOWN BUGS
----------
There is one known bug in this version of the Game of Life screen saver.  When 
run under Windows 95 or Windows NT v4.0, a mini-version of the screen saver 
does not appear in the display properties dialog box.  This is not actually a 
bug, but is instead a result of the fact that I have not yet put forth the 
effort to learn how to do this.  Maybe this will be fixed in the next version.  


LEGAL STUFF
-----------
I hate legal stuff.  This program is freeware.  You may distribute this screen 
saver to anyone you like as long as you don't:

  - change either file (LIFE.SCR or README.TXT) in any way, or
  - separate these files.

If you wish to contact me, you may try sending email to 

  studholme@v-wave.com

or, if that doesn't work, just search for Chris Studholme on the Internet.  
There aren't that many of me (as far as I know, two) so you should have no 
trouble finding me (or the other Chris Studholme out there).  

