home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / gam / life2.ba < prev    next >
Text File  |  2006-10-19  |  3KB  |  61 lines

  1. 0 'Club 100 Library - 415/939-1246 BBS     937-5039 NEWSLETTER, 932-8856 VOICE
  2. 1 'LIFE' 1/11/85 2345 BYTES
  3. 2 'FROM THE WAITE GROUP - GAMES P.75
  4. 3 'Introduction, etc. by STAN KENDALL
  5. 5 GOTO10
  6. 8 INPUT"  <ENTER>";U:CLS:BEEP:RETURN
  7. 10 CLS:DEFINTA-Z:LINE(46,4)-(194,63),1,BF
  8. 15 PRINT@93,"'LIFE' <GR-33>":LINE(50,12)-(190,27),0,B
  9. 20 A=5:B=10:SOUND6269,A:SOUND4968,A:SOUND4184,A:SOUND3516,B:SOUND4184,A:SOUND3516,50
  10. 41 PRINT@168,"'PLAY' PRESS P  'QUIT' Q"
  11. 42 PRINT@251,"'THEORY'   PRESS T"
  12. 43 K$=INKEY$
  13. 44 IFK$="P"ORK$="p"THEN48
  14. 45 IFK$="Q"ORK$="q"THENMENU
  15. 46 IFK$="T"ORK$="k"THEN600
  16. 47 GOTO43
  17. 48 CLEAR:BEEP:CLS:PRINT@42,;
  18. 50 INPUT"Screen Size - Limits 58 & 14";M,N:DIMA(1,M+1,N+1)
  19. 55 PRINT:PRINT" Move Cursor with Cursor Keys."
  20. 60 PRINT" Type 1 for cell, 0 to erase cell."
  21. 75 PRINT" Press L to start design - R to stop"
  22. 80 PRINT:INPUT"   <ENTER> to continue...";U
  23. 90 G=1:I=1:J=1:K=0:L=1:X=1:Y=1:A$="1"
  24. 100 CLS:LINE(0,0)-(4*M+7,4*N+7),1,BF
  25. 110 LINE(4,4)-(4*M+3,4*N+3),0,BF
  26. 130 'Enter First Generation.
  27. 150 LINE(4*I,4*J)-(4*I+3,4*J+3),VAL(A$),BF
  28. 160 A$=INKEY$:IFA$=""THEN160
  29. 170 IFA$="l"ORA$="L"THEN320
  30. 180 IFA$="1"ORA$="0"THENA(0,I,J)=VAL(A$):GOTO150
  31. 190 IF ASC(A$)=28THEN I=I+1:IFI>MTHENI=M
  32. 200 IF ASC(A$)=29THEN I=I-1:IFI<1THENI=1
  33. 210 IF ASC(A$)=30THEN J=J-1:IFJ<1THENJ=1
  34. 220 IF ASC(A$)=31THEN J=J+1:IFJ>NTHENJ=N
  35. 230 LINE(4*X,4*Y)-(4*X+3,4*Y+3),A(0,X,Y),BF
  36. 240 X=I:Y=J:A$="1":GOTO150
  37. 250 FORI=1TOM
  38. 260 FORJ=1TON
  39. 270 LINE(4*I,4*J)-(4*I+3,4*J+3),A(K,I,J),BF
  40. 280 NEXTJ:NEXTI
  41. 300 'Calculate and Print Next Generation.
  42. 320 SOUND8000,1:PRINT@280,"Generation ";G;
  43. 330 FORI=1TOM
  44. 340 FORJ=1TON
  45. 345 IFINKEY$="R"ORINKEY$="r"THEN1
  46. 350 S=A(K,I-1,J-1)+A(K,I,J-1)+A(K,I+1,J-1)+A(K,I-1,J)+A(K,I+1,J)+A(K,I-1,J+1)+A(K,I,J+1)+A(K,I+1,J+1)
  47. 360 IF A(K,I,J)<>0THEN390
  48. 370 IFS<>3THEN A(L,I,J)=0ELSE A(L,I,J)=1:LINE(4*I,4*J)-(4*I+3,4*J+3),1,BF
  49. 380 GOTO400
  50. 390 IF S=2ORS=3THEN A(L,I,J)=1ELSE A(L,I,J)=0:LINE(4*I,4*J)-(4*I+3,4*J+3),0,BF
  51. 400 NEXTJ:NEXTI
  52. 410 K=1-K:L=1-L:G=G+1
  53. 420 GOTO320:'...........
  54. 600 BEEP:CLS:PRINT@41,;
  55. 610 PRINT"'LIFE's changing patterns resemble the  growth of colonies of living organisms  such as microbes, where individual mem- bers are born,live,and die. The player"
  56. 620 PRINT" creates the first generation with the   cursor keys & the computer then prod-   uces later generations.  ";:GOSUB8
  57. 630 PRINT@42,"Each space on the screen can contain a  'cell'. A cell depends on how many      neighbors it has. <1> A cell will be"
  58. 640 PRINT"  'born' if it is surrounded by exactly   three living cells. <2> A cell will     continue to live if it is surrounded    by 2 or 3 living cells.";:GOSUB8
  59. 650 PRINT@42,"<3> A cell will die if surrounded by    <2 or >3 living cells, as though it     dies from loneliness or overcrowding."
  60. 660 PRINT:PRINT"....TRY DIFFERENT STARTING PATTERNS....":PRINT:GOSUB8:GOTO1
  61.