home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 155_01 / oned.doc < prev    next >
Text File  |  1979-12-31  |  6KB  |  136 lines

  1. /* HEADER: xxx.yy;
  2.    TITLE: ONED;
  3.    DATE: 4/30/85;
  4.    DESCRIPTION: "Documentation file for one dimensional cellular automata simulator oned";
  5.    VERSION: 1.0;
  6.    KEYWORDS: Life, cellular automata, games;
  7.    FILENAME: ONED.DOC;
  8.    CRC: xxxx;
  9.    SYSTEM: CP/M, Osborne 1;
  10.    COMPILERS: C/80;
  11.    AUTHORS: David L. Fox;
  12.    REFERENCES: AUTHORS: A. K. Dewdney;
  13.          TITLE: "Computer Recreations";
  14.          CITATION: "Scientific American, 252, 18-30(May 1985).";
  15.          AUTHORS: S. Wolfram;
  16.          TITLE: "Computer Software in Science and Mathematics";
  17.          CITATION: "Scientific American, 251, 188-203(September 1984).";
  18.          AUTHORS: S. Wolfram;
  19.          TITLE: "";
  20.          CITATION: "Physical Review Letters, 54, #8, 735-739(1985)."
  21.       ENDREF
  22. */
  23.     ONED -- A one dimensional Cellular automata simulator.
  24.  
  25.     Copyright 1985 by David L. Fox.
  26.     All rights reserved.
  27.     Permission granted for unlimited
  28.     personal and non-commercial use
  29.     provided that this notice is included.
  30.  
  31.  
  32.      Oned simulates one dimensional totalistic cellular automata
  33. as discussed in the following references:
  34.  
  35. A. K. Dewdney, "Computer Recreations", Scientific American, 
  36.      vol. 252, pp.18-30(May 1985).
  37.  
  38. S. Wolfram, "Computer Software in Science and Mathematics", Scientific 
  39.      American, vol. 251, p.188-203(September 1984). 
  40.  
  41. S. Wolfram, Physical Review Letters, vol. 54 #8, pp.735-739(1985).
  42.  
  43.      Briefly, a cellular automaton consists of an array of cells,
  44. each of which may be in one of several states.  Each cell in the 
  45. array may make a transition to a new state determined by the cell's 
  46. current state and the current state of its neighboring cells.  
  47. All cells making one simultaneous transition constitutes one 
  48. generation.  The game of Life is a well known example of a two 
  49. dimensional cellular automaton.
  50.  
  51.      Oned numbers the possible states of each cell 0, 1, 2, ... 9 
  52. and allows neighborhoods of up to 10 cells on either side of a
  53. central cell.  Totalistic refers to the fact that transitions 
  54. to a new state are determined by the total value of the states 
  55. of all cells in the neighborhood (including the value of the 
  56. state of the cell making the transition).  If an automaton has
  57. s states and a neighborhood of (2*r + 1) cells it is defined by
  58. a transition table containing s*(2*r + 1) entries, each of 
  59. which is the value of the new state corresponding to a given
  60. total of the neighborhood.
  61.  
  62.      When oned is run it responds with a colon (:) and waits for
  63. the user to enter a command.  The following commands are 
  64. recognized:
  65.  
  66. ?        Print a summary of commands.
  67.  
  68. a        Print the definition of the current automaton.  (Number 
  69.          of states, size of neighborhood, and transition table.)
  70.  
  71. d        Display the current state of the cellular automaton as
  72.          one line on the screen.  Cells in state 0 are represented
  73.          by blanks, states one to four by Osborne 1 graphics
  74.          characters and states five through nine by the 
  75.          corresponding digit.
  76.  
  77. e        Define or modify the state of the automaton.  This command
  78.          invokes a simple one dimensional screen editor.  Typing any
  79.          digit (0-9) changes the state of the cell pointed to by the 
  80.          cursor (^).  The cursor is moved using the arrow keys or by
  81.          ^S or ^H for left and ^D or ^L for right.  Pressing z will
  82.          zero every cell in the universe. Any other key will exit
  83.          from the editor and return to command mode.
  84.  
  85. n=xx     Compute and display the next xx generations.
  86.          xx represents an integer between 0 and 32767, inclusive.
  87.          Pressing return displays the next generation,
  88.          equivalent to the command n=1.  If you enter n=20000
  89.          when you meant n=20 pressing ^B will stop the 
  90.          simulation and return to the command prompt (:).
  91.          The display origin may be shifted during the course
  92.          of a simulation by pressing the arrow keys.  This
  93.          will cause the display to jump around and makes
  94.          stationary objects look like gliders.
  95.  
  96. o=xx     Sets the origin of the display window to cell xx.  The 
  97.          origin is the left most cell displayed by the d or n 
  98.          commands.  This command in needed to view the entire
  99.          universe of 250 cells, too many to display at one time
  100.          on the screen.
  101.  
  102. o+xx     Similar to o= except that xx is added to or 
  103. o-xx     subtracted from the current origin.
  104.  
  105. r=xx     Sets the size of the neighborhood (region) to include
  106.          xx cells on either side of a central cell (2*r + 1)
  107.          cells.
  108.  
  109. s=xx     Sets the number of allowed states to xx.
  110.  
  111. t=code   Defines the transition table.  The decimal number code
  112.          is converted to a representation in base s.  The i th
  113.          digit in this representation (counting from the right)
  114.          is the value of the next state when the neighborhood
  115.          total is i.
  116.  
  117. txx=yy   Alternative method of defining the transition table one 
  118.          entry at a time.  The next state is yy when the 
  119.          neighborhood total is xx.  More than one entry can be
  120.          specified in one command: 
  121.               t1=0,2=0,3=1,4=0,5=1,6=0
  122.          is equivalent to t=20 for a r=2, s=2 automaton.
  123.  
  124. x        Exit from oned and return to CP/M.
  125.  
  126.      Portability considerations:  Oned is written in C for 
  127. Software Toolworks C/80 compiler.  The only non-standard 
  128. features used are CtlCk(); and int (*CtlB)(); which implement
  129. the ability to catch the ^B software interrupt.
  130.  
  131.      The screen control sequences used are those for the
  132. Osborne 1.  They are implemented as #define 'ed constants
  133. and may be easily changed to accommodate other computers
  134. and terminals.  The characters in the array stsym will 
  135. probably also have to be changed.
  136.