home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 7 Games / 07-Games.zip / life.zip / life.txt < prev    next >
Text File  |  1994-05-16  |  2KB  |  51 lines

  1. This is a PM implementation of the game of life,
  2. with source.
  3. It has some optional extensions, as it provides
  4. several different cell types.
  5.  
  6. The game of life operates on an array of
  7. cells, whre each cell lives as long as it has
  8. exactly 2 or 3 neighbours out of eight possible, 
  9. and new cells are born into locations with exactly
  10. 3 neighbours.
  11. See life.c and life.cnf for a description
  12. of the extensions, and how to set up
  13. different colors.
  14.  
  15. The program is useful as something to look
  16. at when you are bored.  It may also
  17. be incorporated into a screen-saver.
  18.  
  19. The source is provided as an example of
  20. PM programming.  It isn't very pretty, but
  21. it is free.  The use of semaphores in the
  22. program may seem unnecessary, but it
  23. was necessary when I used a slower
  24. way of drawing.  GpiDrawBits
  25. that I now use is fast, and copies an entire
  26. array of cells in one operation.
  27.  
  28. The program takes 3 required parameters:
  29. life x y size
  30. "x" and "y" is the size of the game - in cells.
  31. "size" is the size of a single cell - in pixels.
  32.  
  33. The game allocates approximately 2*x*y bytes.
  34.  
  35. Examples:
  36. life 800 600 1
  37. This game covers an 800x600 screen, with 1-pixel cells.
  38. It will use 960k for the cell arrays, and turns may
  39. take 5-6 seconds on a 386.
  40.  
  41. life 80 60 10
  42. This will cover an 800x600 screen, with 10 by 10 pixel cells.
  43. It will use 9.6k for data structures, and a 386 will display
  44. several turns per second.
  45.  
  46. life 40 30 2
  47. This gives a 80 by 60 window, wich will update fast.
  48.  
  49.  
  50. The game of life
  51.