Dec 162017
 
Conway's Life program with complete Turbo Pascal source code.
File LIFE9.ZIP from The Programmer’s Corner in
Category Pascal Source Code
Conway’s Life program with complete Turbo Pascal source code.
File Name File Size Zip Size Zip Type
LIFE.COM 15457 10221 deflated
LIFE.DOC 1874 943 deflated
LIFE.PAS 9136 1858 deflated

Download File LIFE9.ZIP Here

Contents of the LIFE.DOC file


Documentation for LIFE.COM by Alex T. Prengel, Jr (requires CGA):

Conway's game of Life, played on an unbounded grid. This version uses dynamic
data structures which impose no limit on the pattern size. The pattern can
grow in any direction; if it reaches the edge of the screen, it simply grows
beyond it, but the visible part is correct, i.e. no artificial conditions
are introduced at the boundary. This is unlikely anyway, since the high reso-
lution graphics screen is used (640x200). The initial pattern is entered in
a text-resolution entry screen; this is then copied to the center of the high
resolution graphics screen. The computation is efficient, in that computation
time is proportional to the number of cells currently alive; this will be
very evident when you run a number of test cases.

The TURBO PASCAL source file LIFE.PAS is supplied, as well as the compiled
form LIFE.COM. The basic ideas are from Data Structures and Program Design
(Kruse, Prentice Hall).

To run either version: get the program running; set the Num Lock state on
(press the Num Lock key). Use arrow keys on keypad to move cursor around
on the screen. Press the 5 key on the keypad to make a cell "live" (shows as
an asterisk). If you change your mind and want a "live" cell "dead", position
the cursor on the cell and hit 5 on keypad, and it will turn off. When the
starting pattern is set, hit return and the computer will transcribe the
pattern to the high resolution graphics screen, and the generations will
evolve. To stop, hit any key at any time (if generations are evolving very
rapidly, this may have to be done several times but it will work eventually).

The pattern is a little hard to see due to the high resolution, but the
benefit is that almost every interesting pattern can be fully followed without
running off the edge of the screen.


 December 16, 2017  Add comments

Leave a Reply