home *** CD-ROM | disk | FTP | other *** search
- AUTOMATON*
-
- Forget_Me_Not
-
- A very simple Margolus neighbourhood two state automaton. This is a good
- example of a reversible automaton which is self inverse; after running the
- automaton for a few generations halt it, click on the phase option & then
- continue - you will see the automaton run backwards!
-
- INITIALISATION*
-
- 10DEF PROCdo
- 20*SetEval wrap on
- 30*SetEval neig margolus
- 40ENDPROC
-
- SCREEN*
-
- 10DEF PROCdo
- 20DIM buf% 256:SYS "OS_ReadVarVal","sux",buf%,256:x%=!buf%/2
- 30SYS "OS_ReadVarVal","suy",buf%,256:y%=!buf%/2
- 40k%=RND(2*x%*.2):f%=((x%AND1ANDNOT(y%AND1))OR(y%AND1ANDNOT(x%AND1)))
- 50GCOL 63 TINT 255:RECTANGLE FILL -k%*4+f%*4,-k%*4,k%*8-2,k%*8-2
- 60ENDPROC
-
- CODE*
-
- ( READ_NEIG
- CCW OPP EOR CW EOR == )
-
- END*