Received: from j.cc.purdue.edu by VM.CC.PURDUE.EDU ; Sun, 28 Feb 88 18:17:11 EST
Received: by j.cc.purdue.edu (5.54/1.14)
    id AA13579; Sun, 28 Feb 88 18:16:19 EST
From: ahh@j.cc.purdue.edu (Brent L. Woods)
Message-Id: <8802282316.AA13579@j.cc.purdue.edu>
To: @vm.cc.purdue.edu:FYS-MA@FINTUVM.BITNET (Matti Aarnio)
Date: Sun, 28 Feb 88 18:16:17 EST
Subject: Re: posting to: news/comp/sources/amiga/volume3
In-Reply-To: Message from "Matti Aarnio" of Feb 27, 88 at 6:50 pm
Organization: Co-Moderators Unlimited.
 
In message <8802281639.AA05059@j.cc.purdue.edu> you write:
>
>Brent, did you send some BINARY without UUENCODE ?
>
>I got (ASCII->EBCDIC transtated) strange stuff, that wasn't either
>ASCII, nor EBCDIC.  Thus: What did happen ?
 
     No, I was using a new shell script that Pat wrote to do everything
except cook breakfast, and one of the files I was archiving was
compressed first (you should have seen the mess in the archives I had
to clean up...).  I think the posting was cells.bas (appended below).
Sorry for any problems I might have caused you.  If it was something
else that got toasted, let me know, and I'll send a replacement.
 
 
--
Brent Woods, Co-Moderator, comp.{sources,binaries}.amiga
 
USENET:   ...!j.cc.purdue.edu!ahh     ARPANET:  ahh@j.cc.purdue.edu
BITNET:   PODUM@PURCCVM               PHONE:  +1 (317) 743-8421
USNAIL:   320 Brown St., #406  /  West Lafayette, IN  47906
 
 
Program Name:  cells.bas
Submitted By:  bnl!creutz@sbcs (michael creutz)
Summary:  A cellular automaton program like life.
Poster Boy:  Brent Woods  (ahh@j.cc.purdue.edu)
Tested.
 
NOTES:
 
================================================================
 
'
'
'    This AmigaBASIC program uses screen GET and PUT functions to
' efficiently demonstrate Fredkin's addition modulo 2  cellular
' automaton rule.  It runs considerably faster with nofastmem toggled.
' The framework can be easily generalized to other rules.  If anyone
' is interested, I have versions implementing Conway's life as well
' as a microcanonical Ising model.
'
'                  Michael Creutz
'                  creutz@bnlvma.bitnet
'                  creutz@bnl.arpa
 
DEFINT a-z
'size parameters
depth=2
xm=1      : ym=1
sx=300    : sy=185
xms=xm+sx : yms=ym+sy
dimlat=3+depth*(sy+1)*INT((sx+16)/16)
DIM lat(dimlat)
DIM xnbr(4)
  xnbr(0)=xm   : ynbr(0)=ym       ' the neighbors of (xm,ym)
  xnbr(1)=xm+1 : ynbr(1)=ym
  xnbr(2)=xm   : ynbr(2)=ym+1
  xnbr(3)=xm-1 : ynbr(3)=ym
  xnbr(4)=xm   : ynbr(4)=ym-1
 
SCREEN 1,320,200,depth,1
  WINDOW 2,"working window",,31,1
  WINDOW 3,"mod2",,31,1
 
' starting image; successive bit planes show older images
' (try other initial pictures)
  size=30
  xmid=xm+sx/2 : ymid=ym+sy/2
  FOR m=1 TO depth
    CLS
    LINE (xmid-size,ymid-size)-(xmid+size,ymid+size),2^(m-1),bf
    GET (xm,ym)-(xms,yms),lat
    WINDOW OUTPUT 2
    PUT (xm,ym),lat,XOR
    GET (xm,ym)-(xms,yms),lat
    GOSUB mod2
  NEXT m
 
WHILE 1 : GOSUB mod2 :WEND    ' main loop
 
mod2:    ' XOR each site with its neighbors
  WINDOW OUTPUT 2
  FOR n=1 TO 4
    PUT (xnbr(n),ynbr(n)),lat
  NEXT n
  GOSUB periodic
  GET (xm,ym)-(xms,yms),lat
  WINDOW OUTPUT 3
  PUT (xm,ym),lat,PSET
RETURN
 
periodic:                        ' make lattice periodic
GET (xm+1,ym)-(xm+1,yms),lat     ' two rows at end repeated
PUT (xms,ym),lat,PSET
GET (xms-1,ym)-(xms-1,yms),lat
PUT (xm,ym),lat,PSET
GET (xm,ym+1)-(xms,ym+1),lat
PUT (xm,yms),lat,PSET
GET (xm,yms-1)-(xms,yms-1),lat
PUT (xm,ym),lat,PSET
RETURN
