home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / cellsim / v2_5 / rule_src / modl2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-02-26  |  343 b   |  30 lines

  1. /*
  2.  * File: mod.l2.c
  3.  *   By: Dave Hiebeler
  4.  *       hiebeler@turing.cs.rpi.edu
  5.  *       August 1989
  6.  *
  7.  * Add up the neighbors and return the sum mod 2.
  8.  */
  9.  
  10.  
  11. #include "nborhood.h"
  12.  
  13. byte mod_rule();
  14.  
  15. void
  16. init_function()
  17. {
  18.     update_function = mod_rule;
  19. }
  20.  
  21.  
  22. byte
  23. mod_rule(nbors)
  24. lr1_nbors *nbors;
  25. {
  26.     Get_l_nbors;
  27.     return (l+c+r)%2;
  28.  
  29. }
  30.