Dec 232017
 
Conway's LIFE Pascal source, quite good.
File PLIFE.ZIP from The Programmer’s Corner in
Category Pascal Source Code
Conway’s LIFE Pascal source, quite good.
File Name File Size Zip Size Zip Type
LIFE.COM 22647 13535 deflated
LIFE.DOC 5743 1956 deflated
LIFE.PAS 26682 6512 deflated

Download File PLIFE.ZIP Here

Contents of the LIFE.DOC file


LIFE.DOC

Contained in PLIFE.ARC you should find the following files:

LIFE.DOC - this file
LIFE.COM - executable program file for MSDOS computers
LIFE.PAS - TURBO-PASCAL source code for program

This program is an implementation of the game of LIFE as developed by
John Horton Conway. For a complete description of the game, see "Wheels,
Life and Other Mathematical Amusements" by Martin Gardner, copyright
1983 by W.H. Freeman and Company.

This particular program was written originally in TURBO-PASCAL on a 64K,
CP/M, BMC if 800 computer by Randall A. Maddox [(301) 428-9581]. It
has since been slightly modified to run on IBM PCs and clones under
PC/MSDOS and has also been translated into Modula-2. The TURBO-PASCAL
version is found in PLIFE.ARC, while the LogiTech Modula-2 version is
found in MLIFE.ARC.

The game is played on a 24 by 80 grid, giving a total of 1920 cells to
be displayed on the screen. The basic idea is to start with a simple
configuration of cells occupied by organisms, then to observe how this
configuration changes as Conway's genetic laws are applied. The genetic
laws are simple:

SURVIVALS: Every organism with either two or three neighbors survives
to become a mature organism in the succeeding generation.

DEATHS: Every organism with less than two or more than three neighbors
dies.

BIRTHS: Each empty cell with exactly three neighbors becomes occupied
by a newborn organism in the succeeding generation.


The first 24 lines of the screen will display the current organism
configuration, while the last line is used for status messages and user
input. The program will ask whether you need instructions upon start
up.

You may start this program in one of three ways:

1) The computer generates a random number of organisms and places
them into the grid at random.

2) You pick a number from 1 to 1920 - current count of organisms,
and the computer randomly places that many organisms into the grid.

3) You place from 1 to 1920 - current count of organisms into the grid
in any configuration you may desire.

You may also modify the current display at any time, adding or removing
organisms at will. Any display may also be written out to your printer.

For purposes of this game, the opposite edges of the screen are consid-
ered to be adjacent. That is, the game display will automatically wrap
around side to side and top to bottom, so that organisms that are on
opposite edges of the screen will be counted as neighbors when computing
the next generation, and any gliders or spaceships that fly off one edge
of the screen will fly back on from the opposite edge.

Some of the common configurations that will occur are identified here:
(See Martin Gardner's book, referenced above, for a much more complete
listing.)


OO OO O O O
OO O O O O O O O O
O O O O O OO
Block OO O
Tub Boat
Pond Beehive


O OO O O OO
O O O O O O O O O O
O O OO O O O O O O
O OO O O OO
Ship O
Barge Long Boat
Long Barge Long Ship


O OO OO O O O OOO

OO O OO OOO OOO OOO
O O O O
Snake O Toad
R-pentomino Letter H
Latin Cross


OO O O O
OOO OO OO O O
OO OO OOO O O
Blinker OO O OOOO
Glider
Beacon Clock Spaceship



The first 11 figures (Block thru Snake) are all stable configurations
that will persist with no change, if not acted upon by other figures.
The next 7 figures (R-pentomino thru Clock) are all oscillating
configurations that go through varying numbers of phases before
returning to their original shape. The last 2 figures (Glider and
Spaceship) are also oscillating configurations, but as they cycle
through their phases, they also move across the screen. They are
active colony organisms!

There are many other stable, oscillating and moving configurations that
may arise. The individual organisms are born, live and die according
to simple rules, but the collection of organisms display dynamic
interactions of fascinating complexity. Hope you have as much fun
with this game as I have!

Randy Maddox
11/23/88

{end of this file}


 December 23, 2017  Add comments

Leave a Reply