home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / cellsim / v2_5 / src / cell.def < prev    next >
Encoding:
Text File  |  1990-02-26  |  2.9 KB  |  118 lines

  1. /****************************************\
  2. *                                        *
  3. *            cell.def                 *
  4. *                         *
  5. *      cellular automaton simulator      *
  6. *                                        *
  7. *         def: definition file          *
  8. *                                        *
  9. *                                        *
  10. \****************************************/
  11.  
  12.  
  13. /*
  14.  *
  15.  * Cellsim copyright 1989, 1990 by Chris Langton and Dave Hiebeler
  16.  * (cgl@lanl.gov, hiebeler@heretic.lanl.gov)
  17.  *
  18.  * This package may be freely distributed, as long as you don't:
  19. * - remove this notice
  20.  * - try to make money by doing so
  21.  * - prevent others from copying it freely
  22.  * - distribute modified versions without clearly documenting your changes
  23.  *   and notifying us
  24.  *
  25.  * Please contact either of the authors listed above if you have questions
  26.  * or feel an exception to any of the above restrictions is in order.
  27.  *
  28.  * If you make changes to the code, or have suggestions for changes,
  29.  * let us know!  If we use your suggestion, you will receive full credit
  30.  * of course.
  31.  */
  32.  
  33. /*****
  34.  * Cellsim history:
  35.  *
  36.  * Cellsim was originally written on Apollo workstations by Chris Langton.
  37.  *
  38.  * Sun versions:
  39.  *
  40.  * - version 1.0
  41.  *   by C. Ferenbaugh and C. Langton
  42.  *   released 09/02/88
  43.  *
  44.  * - version 1.5
  45.  *   by Dave Hiebeler and C. Langton  May - June 1989
  46.  *   released 07/03/89
  47.  *
  48.  * - version 2.0
  49.  *   by Dave Hiebeler and C. Langton  July - August 1989
  50.  *   never officially released (unofficially released 09/08/89)
  51.  *
  52.  * - version 2.5
  53.  *   by Dave Hiebeler and C. Langton  September '89 - February 1990
  54.  *   released 02/26/90
  55.  *****/
  56.  
  57.  
  58.  
  59. #include <stdio.h>
  60.  
  61. #define State    unsigned char
  62.  
  63. #define    BUFLEN    128
  64. #define    ASCZ    '0'
  65. #define UNDEF    (State) '\377'
  66. #define MAXINT 1000000000        /* sufficiently large integer */
  67. #define INTUNDEF -99999        /* for unset integer var defaults */
  68.  
  69. #define TABLE_ERR    -1
  70.  
  71.  
  72. #ifndef TRUE
  73. #define TRUE    01
  74. #endif
  75. #ifndef FALSE
  76. #define FALSE    NULL
  77. #endif
  78.  
  79. #define NBUFFERS    10
  80. #define BUFOP_XOR    1
  81. #define BUFOP_OR    2
  82. #define BUFOP_AND    3
  83. #define BUFOP_LOAD    4
  84. #define BUFOP_SAVE    5
  85. #define BUFOP_SWAP    6
  86.  
  87. #define NH_DEFAULT    0
  88. #define NH_VONN        1
  89. #define NH_MOORE    2
  90. #define NH_LIN        3
  91. #define NH_MARG        4
  92.  
  93. /* to_state converts a character to a numerical state */
  94. #define to_state(c) ((c)<='9' ? (c)-ASCZ : \
  95.             (c)>='a' ? (c)-'a'+10 : (c)-'A'+10)
  96. /* to_char converts a (numerical) state to a character */
  97. #define to_char(n) ((n)==UNDEF ? 'U' :  \
  98.             (n)>9 ? (char) ('A'-10+(n)) : (char) (ASCZ+(n)))
  99.  
  100. /* Definitions for the various types of drawing-modes */
  101. #define HORIZ_LINE    1
  102. #define HORIZ_END    3
  103. #define VERT_LINE    4
  104. #define VERT_END    6
  105. #define ARB_LINE    7
  106. #define ARB_END        8
  107. #define HOLLOW_CIRC    9
  108. #define HOLLOW_EDGE    10
  109. #define SHADED_CIRC    11
  110. #define SHADED_EDGE    12
  111. #define DRAWING_DONE    13
  112.  
  113. /* Types of conditions for automatically terminating runs */
  114. #define NEVER 0
  115. #define NO_CHANGE 1
  116. #define ALL_ZERO 2
  117.  
  118.