General Description
LIFE has been about in many forms for several years. I first wrote it in Z80 assembler for the NASCOM four years ago, and I would recommend that any person who understands the logic of LIFE may enjoy doing it in 6502 Assembler.
To the uninitiated, LIFE simulates cell regeneration. Even operating relatively slowly, as it does in BASIC, it produces a generation every seven seconds creating some lovely results including splendid examples of cell division. The rules of cell regeneration are:
a cell DIES if it has one or less immediate neighbours, or more than three neighbours,
a cell is STABLE if it has just two neighbours,
a new cell is BORN if the location at which it will be created has just three neighbours.
The more ghoulish friends of mine have invented 'CANCER' as a derivative of this simulation.
After the pretty multi-coloured introductions, you decide where you will place a cell in the closed environment of your screen and use the copy key to copy it on to the screen. When satisfied with your creation press the SPACE BAR to wait for the next generation to be computed. ESC gets you out of the program when you have found a stable cell structure or when you are bored.
Detailed Description
Lines 10-190 Here is a pleasure of BBC Basic. A reasonably complicated process is reduced in the main structure to relative simplicity. Line 120 must be altered for version 1.0 and above operating systems - see the manual.
200-390 Very pretty double size characters are drawn all over the screen. Line 270 decides the number of rows, line 280 doubles up the character size and line 290 determines the number of LIFEs on the screen. The RND is used to control the colour of the display
400-650 There is an assembly routine in the manual to read the character on the screen, but this routine simply keeps track of the cursor control keys and calls the toggle procedure to put a cell on or take a cell of the screen. Buffer clearing at line 490 is essential.
660-720 This routine uses the copy key to exchange the position on the screen between a star and no star.
730-840 This routine simply draws the closed environment of the screen.
850-1070 The instructions here are a bit more specific than the rules above. There are actually only three rules for LIFE but for children we have elucidated a bit.
1080-1320 The guts of the operation. Consider a cell pattern as below:
( ) ( ) (1)
( ) (*) ( )
(2) (3) ( )
For any and every position on the screen, if the star represents the point currently being computed each of the other positions marked must be scanned for an alive or non-existent cell. If there are cells at 1, 2 and 3 then the star will be regenerated. This routine does this scan.
1330-1430 This displays the new cell structure.
1440-end Leave out the error report if you like.
Educational Notes
Apart from looking at pretty patterns, the real point of the program is to see if you can create the environment for cell division. To do this students ought to be issued with graph or patterned paper on which their initial pattern can be recorded or decided before entering it to the program. This simulation is very difficult for the less able, and I found that as a simulation it was best restricted to better fifth formers and sixth formers. On the other hand, lower down in the school, fun was had by less able youngsters doing the following:
They were explained, in some cases several times, the rules of LIFE and then issued with 30 cells. They designed, each of them, an initial pattern, and a competition winner was the person whose structure was kept regenerating the longest. Those who reached a stable structure had to have the generation of stability recorded. Inevitably, the processing of the patterns had to be at low use times for the micro.