I was rather bored today and rather than working on the C.A.D program I'm still writing for the Calculator, I decided to throw out a little Cellular automata generator. This program randomly generates a rule for the automata and, depending on whether or not the code has been modified, either applies the rule to a random sequence or to a single point. I wasn't aiming for user-friendliness, so you have to physically change the source to get it to compute from a point, but it contains the code for both. I'd imagine it could be optimized quite a bit.
FnOff ClrHome ClrDraw ZStandard 0->L1(1) 1->L1(2) 0->L1(3) 0->L1(4) 0->L1(5) 0->L1(6) 0->L1(7) 0->L1(8) For(A,1,8 randInt(0,1)->L1(A) End 0->X:0->Y For(x,0,93 randInt(0,1)->F If F=1 Pxl-On(0,X End Pxl-On(0,47 For(Y,1,63 1->X For(X,2,93 Pxl-On(Y+1,X pxl-Test(Y-1,X-1)->B pxl-Test(Y-1,X)->C pxl-Test(Y-1,X+1)->D If B=1:Then If C=1 & D=1 & L1(1)=1 Pxl-On(Y,X If C=1 & D=0 & L1(2)=1 Pxl-On(Y,X If C=0 & D=1 & L1(3)=1 Pxl-On(Y,X If C=0 & D=0 &L1(4)=1 Pxl-On(Y,X End If B=0:Then If C=1 & D=1 & L1(5)=1 Pxl-On(Y,X If C=1 & D=0 & L1(6)=1 Pxl-On(Y,X If C=0 & D=1 & L1(7)=1 Pxl-On(Y,X If C=0 & D=0 & L1(8)=1 Pxl-On(Y,X If getkey=/=0 prgmCELL End Pxl-Off(Y+1,X End End Stop
I've also compiled the .8xp file, although I'm not entirely sure that it was compiled correctly, so use it at your own risk. It's labeled pgrmCELL in the forum attachments.
EDIT: I made a [minor but significant] error in the code. The compiled project will have to be removed and fixed. It can be found under the name "program CELL.8xp" in the forum attachments.
(∂²Ψ)/(∂x²) = -(2m(V(x)-E)Ψ/( ℏ²Ψ)