home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 4 / CD_Magazyn_EXEC_nr_4.iso / Recent / dev / amos / Langton.lha / source / Langton-delay.source next >
Encoding:
Text File  |  2000-11-11  |  350 b   |  17 lines

  1. Screen Open 0,256,256,4,0
  2. Curs Off : Cls 2 : Hide On 
  3. 'Follow A,X,Y,D
  4. X=128 : Y=128 : D=0
  5. Dim M(3,1) : M(0,1)=-1 : M(1,0)=1 : M(2,1)=1 : M(3,0)=-1
  6. Do 
  7.    'ant moves 
  8.    Add X,M(D,0) : Add Y,M(D,1)
  9.    X=X and 255 : Y=Y and 255
  10.    'square flips
  11.    C=Point(X,Y) : Plot X,Y,2-C
  12.    'ant turns 
  13.    If C=2 Then Inc D Else Dec D
  14.    D=D and 3
  15. Wait Vbl 
  16. Loop 
  17.