Inty Life Written by Ian Holbrough (ianholbrough@callnetuk.com) Honorable Mention, Winter 1999 ECS BASIC Programming Competition March 13, 1999 ________________________________________________________________ And finally Life. This is a small version of the Classic cellular automata psuedo game by someone who is now very famous (although their name escapes me). Naturally for the ECS its has had to be cut down somewhat. The game plays itself on a 10 by 10 grid. Initially the grid is filled with life randomly, indicated by the blue blocks. The probability of life is 33%. Then in subsequent rounds whether or not life exists depends upon the number of organisms around each life. In the full game this is calculated by counting the number of organisms in the 8 squares around each point, 0-2 and loneliness prevents an organism from growing. 3-5 and one gorws and flourishes, 6+ and it is swamped and dies. Typically the playing grid is treated as a wrap around world. However, on the ECS this takes FOREVER to recalculate (I did try it). So I cut it down as follows, only the 4 adjacent squares contribute to the count (diagonals do not). With scoring now as follows 2-3, the organism lives, anything else it dies. It still takes quite some time to calculate and draw each round. I have a number of extensions to this which I do not have time to code, debug, and most importantly optimise into the space available (I have them all working individually but I blow the memory at the mo so I cannot integrate them). The biggest of these is the ability to manually change the map to experiment with shapes etc. allowing you to build stable and quasi stable groups - ie they oscillate between a number of stable states (This as far as I can gather was the objective in the original game). Other things, varying the size of the grid, getting the wrap around to work (currently the borders of the grid are populated, but not recalculated in order to keep the code fast and tight). Clearly also speeding the whole damn thing up a bit, would aid its playability, and clearly its not at the point that you hoped yet. I am not sure whether Mandlebrot is achievable or not, its really a cross between the Xn+1 code seen in chaos, and the 2x2ness of life. I got fed up with not knowing when LIFE was going to complete its calculation and start updating. So I added a couple of lines which draw red dots by the side of the grid to show which row it is calculating, and yellow ones to show which row it is updating. Personally, I think its much less frustrating now. Life 1.01 10 CLR 20 DIM AA(64) 70 FM(4)=7 80 PRIN " FASTED PRESENTS..." 90 PRIN " " 100 PRIN " " 110 FM(4)=0 120 PRIN " I L" 130 PRIN " " 140 PRIN " N I" 150 PRIN " " 160 PRIN " T F" 170 PRIN " " 180 PRIN " Y E" 200 FOR A=1TO10 210 FOR B=5TO14 220 C=(A*20)+B 230 BK(C)=0 240 IF (RN(0)>66) BK(C)=1 250 NEXT B 260 NEXT A 500 FOR A=0TO7 501 G=(A*20)+44 502 BK(G)=2 503 G=G+11 504 BK(G)=2 510 FOR B=1TO8 520 D=0 530 C=(A*20)+B 540 C=C+25 550 IF (BK(C)=1) D=D+1 560 C=C+19 570 IF (BK(C)=1) D=D+1 580 C=C+2 590 IF (BK(C)=1) D=D+1 600 C=C+19 610 IF (BK(C)=1) D=D+1 620 C=(A*8)+B 640 AA(C)=1 650 IF (D<2) AA(C)=0 660 IF (D>3) AA(C)=0 670 NEXT B 672 BK(G)=5 673 G=G-11 674 BK(G)=5 680 NEXT A 800 FOR A=0TO7 801 G=(A*20)+44 802 BK(G)=6 803 G=G+11 804 BK(G)=6 810 FOR B=1TO8 820 C=((A+2)*20) 830 C=C+B+5 840 D=(A*8)+B 850 BK(C)=AA(D) 860 NEXT B 862 BK(G)=5 863 G=G-11 864 BK(G)=5 870 NEXT A 880 GOTO 500