home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD2.img
/
d4xx
/
d469
/
fastlife
/
fastlife.doc
< prev
next >
Wrap
Text File
|
1991-03-09
|
14KB
|
430 lines
1;33;40m
F a s t L i f e
0;31;40m
by
1;33;40m
R o n C h a r l t o n
0;31;40m
Version 1.0
24-Feb-91
FastLife is an Amiga implementation of Conway's Game of Life
FastLife may be freely distributed.
1;33;40m
C r e d i t s
0;31;40m
o Intuition Interface and integration by Ron Charlton
o Life Routines by Tom Rokicki and Olaf Seibert
o Simple Requesters by Steve Tibbett
o ARP File Requester by Charlie Heath
o Menus generated by MenuC by Bruce Mackey
1;33;40m
Q u i c k S t a r t
0;31;40m
1. Double-click on the FastLife Icon
2. Select "Project-Open" menu item
3. Type "acorn.life" (no quotes) and press return
4. Click in the center of the screen
5. Select "Control-Run" menu item
1;33;40m
F e a t u r e s
0;31;40m
o Blitter used for high speed (19 generations/second maximum)
o Automatic fallback to 680x0 mode when memory is low
o Four screen sizes
o Full Intuition interface
o Runs from Workbench and CLI
o Uses Heath File Requester (if you have arp.library)
o 153 patterns in text file format
1;33;40m
T h e G a m e o f L i f e
0;31;40m
In 1970 John Horton Conway, a mathematician at the University of
Cambridge, invented the game of Life. It was introduced by
Martin Gardener in his October 1970 Scientific American column.
Conway's goal was to create a board game with simple rules that
would exhibit complex behavior. The game is played on an
infinite checkerboard, or grid, of uniform color. Each square,
or cell, is either alive or dead (ON or OFF). Time moves in
increments; each increment marks the life of one generation.
Each cell's condition in the next generation (ON or OFF) is based
on the life in it and its eight neighboring cells.
123
4*5
678
There are three rules concerning the neighbors:
1. If there are 2 ON neighbors the cell stays ON or OFF
2. If there are 3 ON neighbors the cell is ON
3. 0, 1, 4, 5, 6, 7 or 8 ON neighbors the cell is OFF
The analogy to real life: too many neighbors and the cell dies
from overcrowding, too few neighbors and the cell dies from
loneliness. Three cells results in trisexual mating.
The ON/OFF state is determined for all cells on the board before
changing to the next generation.
Most computer versions of Life have one pixel on the screen
represent on cell on the board, as does FastLife. The screen
resolution determines how many cells are available in FastLife,
so the board is not truly infinite as defined by Conway.
An excellent reference for learning more about the history and
philosophical implications of Life is
The Recursive Universe by William Poundstone,
Contemporary Books, Chicago, 1985
The book consists of alternating chapters about Conway's game of
Life and modern physics, and what the game of Life can reveal
about the beginning of biological life and its replication.
1;33;40m
A b o u t F a s t L i f e
0;31;40m
The desire to combine the speed of Tom Rokicki's blitter Life
routines with an Intuition interface and access to many of the
classic Life patterns led to the development of FastLife. Olaf
Seibert's 32-bit fallback 680x0 mode allows the CPU to take over
when there is insufficient memory to use the blitter.
The storage format for the Life patterns supplied with FastLife
is a simple text file (see File Format below). Although the
current version of FastLife does not allow on-screen editing of
Life patterns, you may use your favorite text editor to create
text file patterns to load into FastLife.
Conway defined an infinite board for Life; FastLife limits itself
to the screen size of the Amiga (320 by 200 to 640 by 400).
Patterns that spread to the edge of the screen will be "eaten"
away there, so you should be sure that you select a screen size
that will contain the entire pattern you want to view. This
corruption of the Life pattern at the edge of the screen is not
detected by FastLife; you must observe for yourself when this
happens.
FastLife ALWAYS calculates the entire screen, unlike some other
implementations of Life. Calculation speed is not dependent on
how many cells are ON or OFF, but only on the screen size, and
whether the blitter or 680x0 is used for calculation.
The following table shows the speed and memory requirements of
FastLife:
FastLife memory usage and speed vs. screen size and calculation
mode on a stock Amiga 2000 (68000 at 7 MHz):
screen calc. Memory generations
size mode CHIP TOTAL per second
------- ------- ---- ----- -----------
320x200 blitter 50k 95k 19.0
320x400 blitter 98k 143k 9.5
640x200 blitter 98k 143k 9.5
640x400 blitter 194k 239k 4.7
320x200 68000 18K 63k 5.5
320x400 68000 34k 79k 2.7
640x200 68000 34k 79k 2.7
640x400 68000 66k 111k 1.3
For a given screen size on a stock Amiga 2000 (68000 chip at 7
Mhz):
blitter mode speed: 4 times 68000 mode
blitter mode CHIP memory: 3 times 68000 mode
blitter mode total memory: 2 times 68000 mode
1;33;40m
S t a r t i n g F a s t L i f e
0;31;40m
You may start FastLife from Workbench by clicking on its icon, or
from CLI by typing
1> FastLife
or
1> run FastLife
You may add the digit "1" to the end of the CLI command to force
FastLife to use the 680x0 CPU rather than the blitter. The 680x0
CPU may be faster on Amigas where the "x" is filled in with "2"
or "3" or "4" (68020, etc.). The command would then be
1> FastLife 1
or
1> run FastLife 1
1;33;40m
U s i n g F a s t L i f e
0;31;40m
FastLife will open its default screen (320 by 200 pixels) which
is the fastest. FastLife will use the blitter if there is
sufficient memory available, otherwise it will automatically fall
back to the 680x0 mode and inform you that it has done so
(assuming you haven't requested the 680x0 mode).
If you use the menu to request a new screen size FastLife will
try to give you that size, but if memory is not available it will
fall back in the following order:
1. Requested screen size with blitter mode
2. Requested screen size with 680x0 mode
3. Default screen size with blitter mode
4. Default screen size with 680x0 mode
In the worst case no screen will be provided and FastLife will
exit with an error message.
If you can't get the screen size and blitter/680x0 mode you want,
try closing other screens, windows and projects/tools to free up
memory. You may even want to reboot the Amiga in case memory has
been fragmented by other programs.
You can use the Left-Amiga-N and Left-Amiga-M key combinations to
expose the FastLife screen or hide it behind the Workbench.
1;33;40m
M e n u s a n d K e y b o a r d S h o r t c u t s
0;31;40m
FastLife has the following menu selections:
Project
New <N>
Open <O>
Save As
Save <S>
Open Again
About
ScreenToBack
Generation
Show
Reset
Screen Size
w320h200
w320h400
w640h200
w640h400
Quit <Q>
Tools
Draw
Enlarge
Control
Once </>
Ten <T>
Run <R>
Pause <P>
"SaveAs", "Save", "Draw" and "Enlarge" are ghosted in the current
version of FastLife and may not be used.
Twiddling with the menus causes FastLife to stop updating new
generations because otherwise it would eat the menus when they
appeared on the screen.
New - "New" clears the screen of ON cells in preparation for a
new pattern.
Open - "Open" allows you to load a new Life pattern from disk.
IF YOU HAVE ARP:
If you have arp.library (ARP 39+, REL1.3) in your LIBS:
directory you will get the Heath File Requester. You will
only be shown files that end in ".life" (upper/lower case
does not matter). Double click on a file name to load it.
IF YOU DO NOT HAVE ARP:
If you do not have arp.library you will see a requester with
a string gadget into which you may type a file name to load.
Be sure you give a path name if the ".life" files are not in
the current directory. Otherwise the loading will proceed as
described above.
There are three file types: Absolute, Relative and Pattern
(denoted in the files with "#A", "#R" or "#P"). An Absolute
file will immediately be displayed on the screen. The other
file types will wait for you to click on the screen to
indicate where to display the pattern from the file.
FastLife will flash the screen when the file has been
loaded, or will indicate if some of the Life pattern falls
off of the screen's edge.
NOTE - the "*.life" files are separated into directories by
screen size. Within the 320 by 200 directory the files are
in sub-directories solely so that floppy disk users won't
have to wait for the Heath requester to load 130 filenames
each time they want to Open a file.
Save As - Not currently implemented
Save - Not currently implemented
Open Again - You may load the previous file again by selecting
"Open Again". If the file is Relative or Pattern you must
again click to show where to load the pattern on the screen.
(You may want to select "New" before using "Open Again". The
file name is not lost when "New" is selected.)
About - Shows the current version number and date, along with
credits to the authors.
ScreenToBack - Sends the FastLife screen to the back (behind the
Workbench screen).
Generation - The "Show" subitem will show the current generation
number. The "Reset" subitem will reset the generation number
to zero.
ScreenSize - Selecting a subitem under screen size will change to
the newly selected size. NOTE: The current Life pattern on the
screen will be lost when a new screen size is selected.
Quit - closes FastLife
-----
Draw - not currently implemented
Enlarge - not currently implemented
-----
Once - causes the screen to advance one generation
Ten - causes the screen to advance ten generations
Run - causes the screen to update continuously
Pause - stops updating of the screen.
-----
NOTE - Twiddling the menu has the same effect as "Pause".
NOTE - Selecting "Once/Ten/Run" will appear to do nothing if
there is no Life pattern on the screen. Open a pattern file
first.
NOTE - You may make multiple menu selections at one time, for
example: Press and hold the right mouse button, point at
"Project-New" and click the left mouse button; point at
"Project-Open" and click the left mouse button. Release the
right mouse button. This will clear the screen and bring up
"Open" in one menu action.
1;33;40m
F i l e F o r m a t
0;31;40m
The Life patterns supplied with FastLife are stored in files that
end in ".life" (The Heath File Requester will display only file
names that end thusly). The patterns were obtained with "xlife"
for X-Windows under UNIX and retain a subset of the formats used
there.
You can make your own Life patterns using your favorite text
editor, just be sure to follow the format described below. Also
be sure that your file name ends in ".life" so the Heath File
Requester will show it. Multitasking on the Amiga will allow you
to jump back and forth between FastLife and your editor to speed
your work.
Picture file format - The "Picture" file format has a "#P" as the
first line. Each line that follows represents a line of cells
across the screen, with "*" being an ON cell and any other
character being an OFF cell.
Example file:
#P
**.
.**
.*.
Absolute file format - The "Absolute" file format consists of
pairs of absolute X-Y addresses of the cells to turn ON, one
pair per line. The file may or may not have "#A" as the
first line.
Relative file format - The first line of a "Relative" file must
contain "#R". Each following line is interpreted as a
relative X-Y address (relative to the position on the screen
where you click) of a cell to turn ON. The upper left of the
image will normally be placed where you click the mouse on
the screen. Two integers may be placed on the first line
following the "#R" to offset the image.
1;33;40m
I n t e r e s t i n g P a t t e r n s
0;31;40m
Alu.life
bunnies.life
f2.life
glider1_2.life
glider2_2.life
gliderglidergun.life
oscillators.life
p24.life
p26.life
p55.life
rabbit.life
randomgun.life
round.life
switchengine.life
1;33;40m
I f y o u h a v e t r o u b l e
0;31;40m
Close screens, windows and projects/tools (or reboot) to free
CHIP and FAST memory if you can't get the screen size you want or
blitter support.
Reboot to remove memory fragmentation.
Be sure you have arp.library in your LIBS: directory (it's not an
absolute requirement but will make your FastLife much easier.
-----
FastLife was developed with Manx Aztec C version 5.0a and has
been tested with Workbench 1.3. Its executable size is less than
25 kilobytes.
1;33;40m
A u t h o r
0;31;40m
FastLife version 1.0
By
Ron Charlton
9002 Balcor Circle
Knoxville, TN 37923
(615)694-0800
PeopleLink: R*CHARLTON