Here's the life program I wrote. As far as I know, it's functional. The problems are that it is very slow, all life dies quickly in anything lower than a 12x12 game, and the matrix that I'm saving to consumes too much space. Any help with this would be appreciated.
Code:
Code:
:1→A
:1→B
:Input D
:{D,D→dim([A]
:Fill 0,[A])
:D+1→D
:If 0:"RANDOM START"
:While B≠D:
:¦ If randInt(1,3)=1:Pxl-Change(A,B)
:¦ If 0:"MOVES ON BETWEEN CELLS"
:¦ A+1→A
:¦ If A=D:Then:
:¦ ¦ B+1→B
:¦ ¦ 1→A
:¦ End
:End
:If 0:"END"
:1→B
:While 1:
:¦ While B≠D:
:¦ ¦ If 0:"MARKS CELLS FOR DEL/CREATE"
:¦ ¦ pxl-Test(A,B)→C
:¦ ¦ pxl-Test(A,B-1)+pxl-Test(A,B+1)+pxl-Test(A-1,B)+pxl-Test(A+1,B)+pxl-Test(A+1,B+1)+pxl-Test(A+1,B-1)+pxl-Test(A-1,B+1)+pxl-Test(A-1,B-1)→P
:¦ ¦
:¦ ¦ Text(50,0,P)
:¦ ¦
:¦ ¦ If C=0 and P=3:1→[A](A,B)
:¦ ¦ If C=1 and P≤1 or P≥4:0→[A](A,B)
:¦ ¦ If 0:"END"
:¦ ¦ If 0:"MOVES ON BETWEEN CELLS"
:¦ ¦ A+1→A
:¦ ¦ If A=D:Then:
:¦ ¦ ¦ B+1→B
:¦ ¦ ¦ 1→A
:¦ ¦ End
:¦ ¦ If 0:"END"
:¦ End
:¦ 1→B
:¦ If 0:"MAKES CHANGES"
:¦ Text(50,0,"HERE"
:¦ While B≠D:
:¦ ¦ If [A](A,B)=1:Then:
:¦ ¦ ¦ Pxl-On(A,B)
:¦ ¦ ¦ Else:
:¦ ¦ ¦ Pxl-Off(A,B)
:¦ ¦ End
:¦ ¦ If 0:"MOVES"
:¦ ¦ A+1→A
:¦ ¦ If A=D:Then:
:¦ ¦ ¦ B+1→B
:¦ ¦ ¦ 1→A
:¦ ¦ End
:¦ ¦ If 0:"END"
:¦ End
:¦ 1→A
:¦ 1→B
:End