spoo@utcsrgv.UUCP (Suk Lee) (03/07/84)
Sitting here with a broken leg, I decided to play with my 100. Here's the Game of Life on a 48x48 grid. Move the little cursor around on the grid with "hjkl" (as in vi) and paint in or erase bug colonies (switch the mode back and forth with "."). Once you've set things as you like, type "S" to start and..... sit back. This is *SLOW*. The "#/49" in the upper left hand corner tells you how many coloumns out of 49 have been processed. Enjoy??? --------------------------------- 0 DEFINT A-Z 1 DIM A(50,50),B(50,50) 2 CLS:X=110:Y=30:LINE (101,6)-(150,55),1,B 3 PRINT@0,"The Game of Life" 4 PRINT@80, "h(H)-move right" 5 PRINT@120,"j(J)- ' down" 6 PRINT@160,"k(K)- ' up " 7 PRINT@200,"l(L)- ' left" 8 PRINT@240,"S -start" 9 PRINT@150,". -- mode" 10 PRINT@195,"Erase" 11 F=0 12 PSET (X,Y) 13 K$=INKEY$ 14 IF K$="l" THEN GOTO 25 15 IF K$="L" THEN GOTO 26 16 IF K$="k" THEN GOTO 27 17 IF K$="K" THEN GOTO 28 18 IF K$="j" THEN GOTO 29 19 IF K$="J" THEN GOTO 30 20 IF K$="h" THEN GOTO 31 21 IF K$="H" THEN GOTO 32 22 IF K$="." THEN GOTO 33 23 IF K$="S" THEN GOTO 37 24 GOTO 13 25 IF X=149 THEN GOTO 13 ELSE XN=X+1:YN=Y:GOTO 35 26 IF X>=139 THEN GOTO 13 ELSE XN=X+10:YN=Y:GOTO 35 27 IF Y=7 THEN GOTO 13 ELSE XN=X:YN=Y-1:GOTO 35 28 IF Y<=17 THEN GOTO 13 ELSE XN=X:YN=Y-10:GOTO 35 29 IF Y=54 THEN GOTO 13 ELSE XN=X:YN=Y+1:GOTO 35 30 IF Y>=44 THEN GOTO 13 ELSE XN=X:YN=Y+10:GOTO 35 31 IF X=102 THEN GOTO 13 ELSE XN=X-1:YN=Y:GOTO 35 32 IF X<=112 THEN GOTO 13 ELSE XN=X-10:YN=Y:GOTO 35 33 XN=X:YN=Y 34 IF F=0 THEN F=1:PSET (X,Y):PRINT@195,"Paint":GOTO 35 ELSE F=0:PRINT@195,"Erase":GOTO 35 35 PSET (XN,YN):IF F=0 THEN PRESET(X,Y):A(XN-100,YN-5)=0 ELSE A(XN-100,YN-5)=1 36 X=XN:Y=YN:GOTO 13 37 CLS:LINE (101,6)-(150,55),1,B 38 FOR X=2 TO 49 39 FOR Y=2 TO 49 40 IF A(X,Y)=1 THEN PSET (X+100,Y+5) 41 NEXT 42 NEXT 43 FOR X=2 TO 49 44 PRINT @0,X;"/49 " 45 FOR Y=2 TO 49 46 S=0 47 FOR XI=-1 TO 1 48 FOR YI=-1 TO 1 49 S=S+A(X+XI,Y+YI) 50 NEXT 51 NEXT 52 S=S-A(X,Y) 53 B(X,Y)=0 54 IF S=3 THEN B(X,Y)=1 55 IF S=2 AND A(X,Y)=1 THEN B(X,Y)=1 56 NEXT 57 NEXT 58 FOR X=2 TO 49 59 FOR Y=2 TO 49 60 IF B(X,Y)=0 THEN PRESET(X+100,Y+5) ELSE PSET (X+100,Y+5) 61 NEXT 62 NEXT 63 FOR X=2 TO 49 64 PRINT @0,X;"/49 " 65 FOR Y=2 TO 49 66 S=0 67 FOR XI=-1 TO 1 68 FOR YI=-1 TO 1 69 S=S+B(X+XI,Y+YI) 70 NEXT 71 NEXT 72 S=S-B(X,Y) 73 A(X,Y)=0 74 IF S=3 THEN A(X,Y)=1 75 IF S=2 AND B(X,Y)=1 THEN A(X,Y)=1 76 NEXT 77 NEXT 78 FOR X=2 TO 49 79 FOR Y=2 TO 49 80 IF A(X,Y)=0 THEN PRESET(X+100,Y+5) ELSE PSET (X+100,Y+5) 81 NEXT 82 NEXT 83 GOTO 43 -------------------------------- Also, can the sysop for the Northern Virginia Model 100 BBS drop me a line? I lost your USENET address. -- From the pooped paws of: Suk Lee ..!{decvax,linus,allegra,ihnp4}!utcsrgv!spoo