home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1922 < prev    next >
Internet Message Format  |  1990-12-28  |  3KB

  1. From: dbell@neccan.oz (David I. Bell)
  2. Newsgroups: alt.sources
  3. Subject: Patch to lifesrc
  4. Message-ID: <828@neccan.oz>
  5. Date: 8 Oct 90 01:19:07 GMT
  6.  
  7.  
  8. The following is a small set of patches to the lifesrc program that I
  9. recently posted.  The most important patch is to search.c, where three
  10. implication rules that I had overlooked have been added.  These new rules
  11. don't affect what is found, but should slightly speed up searching.
  12.  
  13. PS: If anyone finds a period 5 spaceship, please post it to the net under
  14. comp.theory.cell-automata.  You'll probably need a FAST machine to find one.
  15.  
  16. David I. Bell
  17. dbell@pdact.pd.necisa.oz.au
  18.  
  19.  
  20. *** interact.c.OLD    Sun Oct  7 10:48:39 1990
  21. --- interact.c.NEW    Thu Oct  4 14:51:49 1990
  22. ***************
  23. *** 358,364 ****
  24.       }
  25.   
  26.       if ((row <= 0) || (row > rowmax) || (col <= 0) || (col > colmax) ||
  27. !         (state < 0) || (state > 1))
  28.       {
  29.           ttystatus("Illegal cell value\n");
  30.           return;
  31. --- 358,364 ----
  32.       }
  33.   
  34.       if ((row <= 0) || (row > rowmax) || (col <= 0) || (col > colmax) ||
  35. !         ((state != 0) && (state != 1)))
  36.       {
  37.           ttystatus("Illegal cell value\n");
  38.           return;
  39. ***************
  40. *** 451,459 ****
  41.       if (maxcount)
  42.           ttyprintf(" -m%d", maxcount);
  43.       if (viewfreq)
  44. !         ttyprintf(" -v%d", viewfreq / VIEWMULT);
  45.       if (dumpfreq)
  46. !         ttyprintf(" -d%d %s", dumpfreq / DUMPMULT, dumpfile);
  47.       if (outputfile)
  48.           ttyprintf(" -o %s", outputfile);
  49.       ttyprintf("\n");
  50. --- 451,459 ----
  51.       if (maxcount)
  52.           ttyprintf(" -m%d", maxcount);
  53.       if (viewfreq)
  54. !         ttyprintf(" -v%ld", viewfreq / VIEWMULT);
  55.       if (dumpfreq)
  56. !         ttyprintf(" -d%ld %s", dumpfreq / DUMPMULT, dumpfile);
  57.       if (outputfile)
  58.           ttyprintf(" -o %s", outputfile);
  59.       ttyprintf("\n");
  60. ***************
  61. *** 747,753 ****
  62.   
  63.       fp = fopen(file, "r");
  64.       if (fp == NULL) {
  65. -     CELL    **set;
  66.           ttystatus("Cannot open \"%s\"\n", file);
  67.           return ERROR;
  68.       }
  69. --- 747,752 ----
  70. *** search.c.OLD    Sun Oct  7 10:47:04 1990
  71. --- search.c.NEW    Sun Oct  7 09:57:24 1990
  72. ***************
  73. *** 1086,1091 ****
  74. --- 1086,1095 ----
  75.               break;
  76.   
  77.           case ON:
  78. +             if ((OFFcount == 4) && (ONcount == 2))
  79. +                 flags |= N0ICUN1;
  80. +             if ((OFFcount == 5) && (ONcount == 1))
  81. +                 flags |= N0ICUN0;
  82.               if (OFFcount == 6)
  83.                   flags |= N1ICUN1;
  84.               if ((ONcount == 1) && (UNKcount == 1))
  85. ***************
  86. *** 1097,1102 ****
  87. --- 1101,1108 ----
  88.                   flags |= (N1ICUN1 | N1IC1);
  89.               if ((ONcount == 2) && (UNKcount == 0))
  90.                   flags |= (N0IC0 | N1IC1);
  91. +             if ((ONcount == 2) && (OFFcount == 5))
  92. +                 flags |= (N0IC0 | N0ICUN0);
  93.               break;
  94.       }
  95.       if (UNKcount == 0)
  96. END OF PATCHES
  97. D
  98.