Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92 » !AWJan92/Goodies/ArcAut/Automatons/BBM

!AWJan92/Goodies/ArcAut/Automatons/BBM

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92
Filename: !AWJan92/Goodies/ArcAut/Automatons/BBM
Read OK:
File size: 0947 bytes
Load address: 0000
Exec address: 0000
File contents
AUTOMATON*

  BBM

  This provides the basic components for a ballistic computer. Information
  is passed by 'billiard balls' bouncing around off each other & 'mirrors'.
  It is a two state automaton; both balls & mirrors are composite objects.
  The current code simply scatters balls & mirrors randomly in the window to
  demonstrate the automaton. Unlike the logical operator OR, fundamental to
  actual computers, all the processes in BBM are reversible (alter 'phase' in
  menu to see this); the Margolus neighbourhood was originally devised to
  implement such a device. Whether this could be done was a particularly
  interesting question because the actual physical laws governing all matter
  (as currently understood) are reversible, unlike most of the processes that
  we observe (like the operation of this computer, or the breaking of a
  glass); this dichotomy is explained by the second law of thermodynamics! -
  there are far more states that we perceive as disordered than ordered, thus
  the chance of a reversible process taking an arbitrary disordered state to
  an ordered one is small. You can demonstrate this for yourself; take one
  political party, place in the position of government for twelve years &
  watch what happens to the economy, employment levels, national health
  service & so on.

INITIALISATION*

  10DEF PROCdo
  20*SetEval wrap off
  30*SetEval border 255
  40*SetEval neig margolus
  50ENDPROC

SCREEN*

  10DEF PROCdo
  20DIM buf% 256:SYS "OS_ReadVarVal","sux",buf%,256:sx%=!buf%
  30SYS "OS_ReadVarVal","suy",buf%,256:sy%=!buf%
  40GCOL 63 TINT 255
  50FOR Q%=1 TO 20*sx%*sy%/(128*128)
  60PROCmirror(RND(sx%/2)-sx%/4,RND(sy%/2)-sy%/4,RND(32),RND(2)-1)
  70NEXT
  80FOR Q%=1 TO 10*sx%*sy%/(128*128)
  90PROCball(RND(sx%/2)-sx%/4,RND(sy%/2)-sy%/4,RND(4)-1)
 100NEXT
 110ENDPROC
 120DEF PROCmirror(x,y,l,f)
 130IF f THEN
 140RECTANGLE FILL 8*x+4,8*y,8*l-1,7
 150ELSE
 160RECTANGLE FILL 8*x+4,8*y,7,8*l-1
 170ENDIF
 180ENDPROC
 190DEF PROCball(x,y,f)
 200CASE f OF
 210WHEN 0:POINT 8*x,8*y:POINT 8*x+8,8*y+8
 220WHEN 1:POINT 8*x-4,8*y-4:POINT 8*x+4,8*y+4
 230WHEN 2:POINT 8*x+4,8*y:POINT 8*x-4,8*y+8
 240WHEN 3:POINT 8*x,8*y+4:POINT 8*x+8,8*y-4
 250ENDCASE
 260ENDPROC

CODE*

( READ_NEIG
  255 SCOUNT_ALL DUP 1 = IF (OPP ==)
                     2 = IF (CELL OPP = IF (CW ==) CELL ==)
                             CELL == )

END*
00000000  41 55 54 4f 4d 41 54 4f  4e 2a 0a 0a 20 20 42 42  |AUTOMATON*..  BB|
00000010  4d 0a 0a 20 20 54 68 69  73 20 70 72 6f 76 69 64  |M..  This provid|
00000020  65 73 20 74 68 65 20 62  61 73 69 63 20 63 6f 6d  |es the basic com|
00000030  70 6f 6e 65 6e 74 73 20  66 6f 72 20 61 20 62 61  |ponents for a ba|
00000040  6c 6c 69 73 74 69 63 20  63 6f 6d 70 75 74 65 72  |llistic computer|
00000050  2e 20 49 6e 66 6f 72 6d  61 74 69 6f 6e 0a 20 20  |. Information.  |
00000060  69 73 20 70 61 73 73 65  64 20 62 79 20 27 62 69  |is passed by 'bi|
00000070  6c 6c 69 61 72 64 20 62  61 6c 6c 73 27 20 62 6f  |lliard balls' bo|
00000080  75 6e 63 69 6e 67 20 61  72 6f 75 6e 64 20 6f 66  |uncing around of|
00000090  66 20 65 61 63 68 20 6f  74 68 65 72 20 26 20 27  |f each other & '|
000000a0  6d 69 72 72 6f 72 73 27  2e 0a 20 20 49 74 20 69  |mirrors'..  It i|
000000b0  73 20 61 20 74 77 6f 20  73 74 61 74 65 20 61 75  |s a two state au|
000000c0  74 6f 6d 61 74 6f 6e 3b  20 62 6f 74 68 20 62 61  |tomaton; both ba|
000000d0  6c 6c 73 20 26 20 6d 69  72 72 6f 72 73 20 61 72  |lls & mirrors ar|
000000e0  65 20 63 6f 6d 70 6f 73  69 74 65 20 6f 62 6a 65  |e composite obje|
000000f0  63 74 73 2e 0a 20 20 54  68 65 20 63 75 72 72 65  |cts..  The curre|
00000100  6e 74 20 63 6f 64 65 20  73 69 6d 70 6c 79 20 73  |nt code simply s|
00000110  63 61 74 74 65 72 73 20  62 61 6c 6c 73 20 26 20  |catters balls & |
00000120  6d 69 72 72 6f 72 73 20  72 61 6e 64 6f 6d 6c 79  |mirrors randomly|
00000130  20 69 6e 20 74 68 65 20  77 69 6e 64 6f 77 20 74  | in the window t|
00000140  6f 0a 20 20 64 65 6d 6f  6e 73 74 72 61 74 65 20  |o.  demonstrate |
00000150  74 68 65 20 61 75 74 6f  6d 61 74 6f 6e 2e 20 55  |the automaton. U|
00000160  6e 6c 69 6b 65 20 74 68  65 20 6c 6f 67 69 63 61  |nlike the logica|
00000170  6c 20 6f 70 65 72 61 74  6f 72 20 4f 52 2c 20 66  |l operator OR, f|
00000180  75 6e 64 61 6d 65 6e 74  61 6c 20 74 6f 0a 20 20  |undamental to.  |
00000190  61 63 74 75 61 6c 20 63  6f 6d 70 75 74 65 72 73  |actual computers|
000001a0  2c 20 61 6c 6c 20 74 68  65 20 70 72 6f 63 65 73  |, all the proces|
000001b0  73 65 73 20 69 6e 20 42  42 4d 20 61 72 65 20 72  |ses in BBM are r|
000001c0  65 76 65 72 73 69 62 6c  65 20 28 61 6c 74 65 72  |eversible (alter|
000001d0  20 27 70 68 61 73 65 27  20 69 6e 0a 20 20 6d 65  | 'phase' in.  me|
000001e0  6e 75 20 74 6f 20 73 65  65 20 74 68 69 73 29 3b  |nu to see this);|
000001f0  20 74 68 65 20 4d 61 72  67 6f 6c 75 73 20 6e 65  | the Margolus ne|
00000200  69 67 68 62 6f 75 72 68  6f 6f 64 20 77 61 73 20  |ighbourhood was |
00000210  6f 72 69 67 69 6e 61 6c  6c 79 20 64 65 76 69 73  |originally devis|
00000220  65 64 20 74 6f 0a 20 20  69 6d 70 6c 65 6d 65 6e  |ed to.  implemen|
00000230  74 20 73 75 63 68 20 61  20 64 65 76 69 63 65 2e  |t such a device.|
00000240  20 57 68 65 74 68 65 72  20 74 68 69 73 20 63 6f  | Whether this co|
00000250  75 6c 64 20 62 65 20 64  6f 6e 65 20 77 61 73 20  |uld be done was |
00000260  61 20 70 61 72 74 69 63  75 6c 61 72 6c 79 0a 20  |a particularly. |
00000270  20 69 6e 74 65 72 65 73  74 69 6e 67 20 71 75 65  | interesting que|
00000280  73 74 69 6f 6e 20 62 65  63 61 75 73 65 20 74 68  |stion because th|
00000290  65 20 61 63 74 75 61 6c  20 70 68 79 73 69 63 61  |e actual physica|
000002a0  6c 20 6c 61 77 73 20 67  6f 76 65 72 6e 69 6e 67  |l laws governing|
000002b0  20 61 6c 6c 20 6d 61 74  74 65 72 0a 20 20 28 61  | all matter.  (a|
000002c0  73 20 63 75 72 72 65 6e  74 6c 79 20 75 6e 64 65  |s currently unde|
000002d0  72 73 74 6f 6f 64 29 20  61 72 65 20 72 65 76 65  |rstood) are reve|
000002e0  72 73 69 62 6c 65 2c 20  75 6e 6c 69 6b 65 20 6d  |rsible, unlike m|
000002f0  6f 73 74 20 6f 66 20 74  68 65 20 70 72 6f 63 65  |ost of the proce|
00000300  73 73 65 73 20 74 68 61  74 0a 20 20 77 65 20 6f  |sses that.  we o|
00000310  62 73 65 72 76 65 20 28  6c 69 6b 65 20 74 68 65  |bserve (like the|
00000320  20 6f 70 65 72 61 74 69  6f 6e 20 6f 66 20 74 68  | operation of th|
00000330  69 73 20 63 6f 6d 70 75  74 65 72 2c 20 6f 72 20  |is computer, or |
00000340  74 68 65 20 62 72 65 61  6b 69 6e 67 20 6f 66 20  |the breaking of |
00000350  61 0a 20 20 67 6c 61 73  73 29 3b 20 74 68 69 73  |a.  glass); this|
00000360  20 64 69 63 68 6f 74 6f  6d 79 20 69 73 20 65 78  | dichotomy is ex|
00000370  70 6c 61 69 6e 65 64 20  62 79 20 74 68 65 20 73  |plained by the s|
00000380  65 63 6f 6e 64 20 6c 61  77 20 6f 66 20 74 68 65  |econd law of the|
00000390  72 6d 6f 64 79 6e 61 6d  69 63 73 21 20 2d 0a 20  |rmodynamics! -. |
000003a0  20 74 68 65 72 65 20 61  72 65 20 66 61 72 20 6d  | there are far m|
000003b0  6f 72 65 20 73 74 61 74  65 73 20 74 68 61 74 20  |ore states that |
000003c0  77 65 20 70 65 72 63 65  69 76 65 20 61 73 20 64  |we perceive as d|
000003d0  69 73 6f 72 64 65 72 65  64 20 74 68 61 6e 20 6f  |isordered than o|
000003e0  72 64 65 72 65 64 2c 20  74 68 75 73 0a 20 20 74  |rdered, thus.  t|
000003f0  68 65 20 63 68 61 6e 63  65 20 6f 66 20 61 20 72  |he chance of a r|
00000400  65 76 65 72 73 69 62 6c  65 20 70 72 6f 63 65 73  |eversible proces|
00000410  73 20 74 61 6b 69 6e 67  20 61 6e 20 61 72 62 69  |s taking an arbi|
00000420  74 72 61 72 79 20 64 69  73 6f 72 64 65 72 65 64  |trary disordered|
00000430  20 73 74 61 74 65 20 74  6f 0a 20 20 61 6e 20 6f  | state to.  an o|
00000440  72 64 65 72 65 64 20 6f  6e 65 20 69 73 20 73 6d  |rdered one is sm|
00000450  61 6c 6c 2e 20 59 6f 75  20 63 61 6e 20 64 65 6d  |all. You can dem|
00000460  6f 6e 73 74 72 61 74 65  20 74 68 69 73 20 66 6f  |onstrate this fo|
00000470  72 20 79 6f 75 72 73 65  6c 66 3b 20 74 61 6b 65  |r yourself; take|
00000480  20 6f 6e 65 0a 20 20 70  6f 6c 69 74 69 63 61 6c  | one.  political|
00000490  20 70 61 72 74 79 2c 20  70 6c 61 63 65 20 69 6e  | party, place in|
000004a0  20 74 68 65 20 70 6f 73  69 74 69 6f 6e 20 6f 66  | the position of|
000004b0  20 67 6f 76 65 72 6e 6d  65 6e 74 20 66 6f 72 20  | government for |
000004c0  74 77 65 6c 76 65 20 79  65 61 72 73 20 26 0a 20  |twelve years &. |
000004d0  20 77 61 74 63 68 20 77  68 61 74 20 68 61 70 70  | watch what happ|
000004e0  65 6e 73 20 74 6f 20 74  68 65 20 65 63 6f 6e 6f  |ens to the econo|
000004f0  6d 79 2c 20 65 6d 70 6c  6f 79 6d 65 6e 74 20 6c  |my, employment l|
00000500  65 76 65 6c 73 2c 20 6e  61 74 69 6f 6e 61 6c 20  |evels, national |
00000510  68 65 61 6c 74 68 0a 20  20 73 65 72 76 69 63 65  |health.  service|
00000520  20 26 20 73 6f 20 6f 6e  2e 0a 0a 49 4e 49 54 49  | & so on...INITI|
00000530  41 4c 49 53 41 54 49 4f  4e 2a 0a 0a 20 20 31 30  |ALISATION*..  10|
00000540  44 45 46 20 50 52 4f 43  64 6f 0a 20 20 32 30 2a  |DEF PROCdo.  20*|
00000550  53 65 74 45 76 61 6c 20  77 72 61 70 20 6f 66 66  |SetEval wrap off|
00000560  0a 20 20 33 30 2a 53 65  74 45 76 61 6c 20 62 6f  |.  30*SetEval bo|
00000570  72 64 65 72 20 32 35 35  0a 20 20 34 30 2a 53 65  |rder 255.  40*Se|
00000580  74 45 76 61 6c 20 6e 65  69 67 20 6d 61 72 67 6f  |tEval neig margo|
00000590  6c 75 73 0a 20 20 35 30  45 4e 44 50 52 4f 43 0a  |lus.  50ENDPROC.|
000005a0  0a 53 43 52 45 45 4e 2a  0a 0a 20 20 31 30 44 45  |.SCREEN*..  10DE|
000005b0  46 20 50 52 4f 43 64 6f  0a 20 20 32 30 44 49 4d  |F PROCdo.  20DIM|
000005c0  20 62 75 66 25 20 32 35  36 3a 53 59 53 20 22 4f  | buf% 256:SYS "O|
000005d0  53 5f 52 65 61 64 56 61  72 56 61 6c 22 2c 22 73  |S_ReadVarVal","s|
000005e0  75 78 22 2c 62 75 66 25  2c 32 35 36 3a 73 78 25  |ux",buf%,256:sx%|
000005f0  3d 21 62 75 66 25 0a 20  20 33 30 53 59 53 20 22  |=!buf%.  30SYS "|
00000600  4f 53 5f 52 65 61 64 56  61 72 56 61 6c 22 2c 22  |OS_ReadVarVal","|
00000610  73 75 79 22 2c 62 75 66  25 2c 32 35 36 3a 73 79  |suy",buf%,256:sy|
00000620  25 3d 21 62 75 66 25 0a  20 20 34 30 47 43 4f 4c  |%=!buf%.  40GCOL|
00000630  20 36 33 20 54 49 4e 54  20 32 35 35 0a 20 20 35  | 63 TINT 255.  5|
00000640  30 46 4f 52 20 51 25 3d  31 20 54 4f 20 32 30 2a  |0FOR Q%=1 TO 20*|
00000650  73 78 25 2a 73 79 25 2f  28 31 32 38 2a 31 32 38  |sx%*sy%/(128*128|
00000660  29 0a 20 20 36 30 50 52  4f 43 6d 69 72 72 6f 72  |).  60PROCmirror|
00000670  28 52 4e 44 28 73 78 25  2f 32 29 2d 73 78 25 2f  |(RND(sx%/2)-sx%/|
00000680  34 2c 52 4e 44 28 73 79  25 2f 32 29 2d 73 79 25  |4,RND(sy%/2)-sy%|
00000690  2f 34 2c 52 4e 44 28 33  32 29 2c 52 4e 44 28 32  |/4,RND(32),RND(2|
000006a0  29 2d 31 29 0a 20 20 37  30 4e 45 58 54 0a 20 20  |)-1).  70NEXT.  |
000006b0  38 30 46 4f 52 20 51 25  3d 31 20 54 4f 20 31 30  |80FOR Q%=1 TO 10|
000006c0  2a 73 78 25 2a 73 79 25  2f 28 31 32 38 2a 31 32  |*sx%*sy%/(128*12|
000006d0  38 29 0a 20 20 39 30 50  52 4f 43 62 61 6c 6c 28  |8).  90PROCball(|
000006e0  52 4e 44 28 73 78 25 2f  32 29 2d 73 78 25 2f 34  |RND(sx%/2)-sx%/4|
000006f0  2c 52 4e 44 28 73 79 25  2f 32 29 2d 73 79 25 2f  |,RND(sy%/2)-sy%/|
00000700  34 2c 52 4e 44 28 34 29  2d 31 29 0a 20 31 30 30  |4,RND(4)-1). 100|
00000710  4e 45 58 54 0a 20 31 31  30 45 4e 44 50 52 4f 43  |NEXT. 110ENDPROC|
00000720  0a 20 31 32 30 44 45 46  20 50 52 4f 43 6d 69 72  |. 120DEF PROCmir|
00000730  72 6f 72 28 78 2c 79 2c  6c 2c 66 29 0a 20 31 33  |ror(x,y,l,f). 13|
00000740  30 49 46 20 66 20 54 48  45 4e 0a 20 31 34 30 52  |0IF f THEN. 140R|
00000750  45 43 54 41 4e 47 4c 45  20 46 49 4c 4c 20 38 2a  |ECTANGLE FILL 8*|
00000760  78 2b 34 2c 38 2a 79 2c  38 2a 6c 2d 31 2c 37 0a  |x+4,8*y,8*l-1,7.|
00000770  20 31 35 30 45 4c 53 45  0a 20 31 36 30 52 45 43  | 150ELSE. 160REC|
00000780  54 41 4e 47 4c 45 20 46  49 4c 4c 20 38 2a 78 2b  |TANGLE FILL 8*x+|
00000790  34 2c 38 2a 79 2c 37 2c  38 2a 6c 2d 31 0a 20 31  |4,8*y,7,8*l-1. 1|
000007a0  37 30 45 4e 44 49 46 0a  20 31 38 30 45 4e 44 50  |70ENDIF. 180ENDP|
000007b0  52 4f 43 0a 20 31 39 30  44 45 46 20 50 52 4f 43  |ROC. 190DEF PROC|
000007c0  62 61 6c 6c 28 78 2c 79  2c 66 29 0a 20 32 30 30  |ball(x,y,f). 200|
000007d0  43 41 53 45 20 66 20 4f  46 0a 20 32 31 30 57 48  |CASE f OF. 210WH|
000007e0  45 4e 20 30 3a 50 4f 49  4e 54 20 38 2a 78 2c 38  |EN 0:POINT 8*x,8|
000007f0  2a 79 3a 50 4f 49 4e 54  20 38 2a 78 2b 38 2c 38  |*y:POINT 8*x+8,8|
00000800  2a 79 2b 38 0a 20 32 32  30 57 48 45 4e 20 31 3a  |*y+8. 220WHEN 1:|
00000810  50 4f 49 4e 54 20 38 2a  78 2d 34 2c 38 2a 79 2d  |POINT 8*x-4,8*y-|
00000820  34 3a 50 4f 49 4e 54 20  38 2a 78 2b 34 2c 38 2a  |4:POINT 8*x+4,8*|
00000830  79 2b 34 0a 20 32 33 30  57 48 45 4e 20 32 3a 50  |y+4. 230WHEN 2:P|
00000840  4f 49 4e 54 20 38 2a 78  2b 34 2c 38 2a 79 3a 50  |OINT 8*x+4,8*y:P|
00000850  4f 49 4e 54 20 38 2a 78  2d 34 2c 38 2a 79 2b 38  |OINT 8*x-4,8*y+8|
00000860  0a 20 32 34 30 57 48 45  4e 20 33 3a 50 4f 49 4e  |. 240WHEN 3:POIN|
00000870  54 20 38 2a 78 2c 38 2a  79 2b 34 3a 50 4f 49 4e  |T 8*x,8*y+4:POIN|
00000880  54 20 38 2a 78 2b 38 2c  38 2a 79 2d 34 0a 20 32  |T 8*x+8,8*y-4. 2|
00000890  35 30 45 4e 44 43 41 53  45 0a 20 32 36 30 45 4e  |50ENDCASE. 260EN|
000008a0  44 50 52 4f 43 0a 0a 43  4f 44 45 2a 0a 0a 28 20  |DPROC..CODE*..( |
000008b0  52 45 41 44 5f 4e 45 49  47 0a 20 20 32 35 35 20  |READ_NEIG.  255 |
000008c0  53 43 4f 55 4e 54 5f 41  4c 4c 20 44 55 50 20 31  |SCOUNT_ALL DUP 1|
000008d0  20 3d 20 49 46 20 28 4f  50 50 20 3d 3d 29 0a 20  | = IF (OPP ==). |
000008e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000008f0  20 20 20 20 32 20 3d 20  49 46 20 28 43 45 4c 4c  |    2 = IF (CELL|
00000900  20 4f 50 50 20 3d 20 49  46 20 28 43 57 20 3d 3d  | OPP = IF (CW ==|
00000910  29 20 43 45 4c 4c 20 3d  3d 29 0a 20 20 20 20 20  |) CELL ==).     |
00000920  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000930  20 20 20 20 20 20 20 20  43 45 4c 4c 20 3d 3d 20  |        CELL == |
00000940  29 0a 0a 45 4e 44 2a                              |)..END*|
00000947