home *** CD-ROM | disk | FTP | other *** search
/ The Best of Select: Games 3 / cd.iso / os2 / life2 / life2.doc < prev    next >
Text File  |  1993-09-05  |  4KB  |  115 lines

  1.  
  2. Life2 - John Horton Conway's cellular simulation as implemented by
  3.         Charles Petzold in his book "Programming the OS/2 Presentation
  4.         Manager" with a number of enhancements by me, Larry Nomer.
  5.  
  6.  
  7. The LIFE Simulation
  8. -------------------
  9.  
  10. Start with a pattern of cells on a square grid.  Each generation a new
  11. cell will be "born" in any empty square bordering (horiz, vertically, or
  12. diagonally) on exactly three other cells.  Existing cells with one or no
  13. neighbors will die of "exposure".  Existing cells with four or more
  14. neighbors will die of "overcrowding".
  15.  
  16. A number of interesting cell patterns have been discovered.  They are shown
  17. below along with a name.  Try then!
  18.  
  19.  
  20.  
  21. Stable patterns:     Block:  x x     Pond      x x       Blinker:   x
  22.                              x x             x     x                x
  23.                                                x x                  x
  24.  
  25. (Note:  The cells in "Block" above are all right next to each other.
  26.         A horizontal space between the "x"s has been inserted in all of
  27.         diagrams here for readability.)
  28.  
  29.  
  30. Super "fertile":   x x      (Lack of vertical or horizontal symmetry often
  31.                      x x     has more interesting results.)
  32.                      x
  33.  
  34. Glider:       x       (Repeats its same shape every fourth generation but
  35.                 x      shifted over one and down one.  i.e.  It travels
  36.             x x x      across the screen at a 45 degree angle.
  37.  
  38.  
  39. Spaceship:   x     x       (Travels straight vertically or horizontally at
  40.                      x      a rate of two squares in four generations.)
  41.              x       x     (Note:  I found this pattern by watching a
  42.                x x x x      randomly generated grid.  However, I am sure
  43.                             it must have been included in the various
  44.                             Scientific American articles on Life.)
  45.  
  46.  
  47. Enhancements to Petzold's program
  48. ---------------------------------
  49.  
  50. First, let me say that Charles Petzold is a super programmer and he has
  51. implemented the basic Life program very elegantly and efficiently.  I am
  52. a mere average "journeyman" programmer working to get better at OS/2
  53. Presentation Manager programming.
  54.  
  55. o  Upgrade to 2.x.  Code upgraded from OS/2 1.3 (or 1.2) to OS/2 2.x
  56.  
  57. o  Random.  Added "Random" function to fill the grid randomly with X % cells.
  58.  
  59. o  Drawing.  If you hold mouse button 1 down then you will draw cells onto
  60.              the grid.  Holding MB2 will draw the background grid color.
  61.  
  62. o  Grid Wrap.  Added grid wrapping from left to right and top to bottom.
  63.                (Grid edges were originally dead ends.)
  64.  
  65. o  Colors.  Added support for setting cell and background colors.
  66.             (Original version was black on white only.)
  67.  
  68. o  Profile save.  Your current grid size, window position, and colors are
  69.                   now automatically saved and restored.
  70.  
  71.  
  72. Future Enhancements
  73. -------------------
  74.  
  75. o  Templates.  I plan to add a "Draw Mode/Templates" switch, probably under
  76.                a menu bar "Input" choice.  Draw Mode would work like today's
  77.                program drawing with MB1 and MB2.  Templates mode will let
  78.                you select from pre-defined templates of gliders, spaceships,
  79.                blocks, etc. and then place them on the grid by clicking MB1.
  80.                (Erase with MB2.)
  81.  
  82. o  Game mode.  Perhaps a game mode where you try to destroy a spaceship
  83.                convoy by hitting it from the side with gliders shot from a
  84.                distance (good score would be fewest gliders or fewest
  85.                generations until an empty or stable pattern is reached.)
  86.                Other game ideas welcome!
  87.  
  88. o  Cut and Paste.  Would be nice to be able to cut interesting patterns from
  89.                    the grid and save them in a template file for later use.
  90.  
  91.  
  92. Known Bugs
  93. ----------
  94.  
  95. Minimizing the LIFE window loses your current pattern and results in a message
  96. about there not being enough room for even one cell.
  97.  
  98.  
  99. Usual Disclaimer
  100. ----------------
  101.  
  102. This code is, of course, distributed with any explicit or implicit warranties
  103. of any kind.  This package, which includes source code, is FreeWare.  It may
  104. be freely copied or distributed in its entirety.
  105.  
  106.  
  107. Comments or Suggestions
  108. -----------------------
  109.  
  110. Comments and/or suggestions are welcome.  Send them to Internet address:
  111.  
  112. gnomer@aol.com
  113.  
  114. -Larry Nomer
  115.