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

  1. /*
  2.  * File: mod.l2r2.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.  
  16. void
  17. init_function()
  18. {
  19.     update_function = mod_rule;
  20. }
  21.  
  22.  
  23. byte
  24. mod_rule(nbors)
  25. lr2_nbors *nbors;
  26. {
  27.     Get_lr2_nbors;
  28.     return (ll+l+c+r+rr)%2;
  29.  
  30. }
  31.