Patch to lifesrc

David I. Bell dbell at neccan.oz
Mon Oct 8 11:19:07 AEST 1990


The following is a small set of patches to the lifesrc program that I
recently posted.  The most important patch is to search.c, where three
implication rules that I had overlooked have been added.  These new rules
don't affect what is found, but should slightly speed up searching.

PS: If anyone finds a period 5 spaceship, please post it to the net under
comp.theory.cell-automata.  You'll probably need a FAST machine to find one.

David I. Bell
dbell at pdact.pd.necisa.oz.au


*** interact.c.OLD	Sun Oct  7 10:48:39 1990
--- interact.c.NEW	Thu Oct  4 14:51:49 1990
***************
*** 358,364 ****
  	}
  
  	if ((row <= 0) || (row > rowmax) || (col <= 0) || (col > colmax) ||
! 		(state < 0) || (state > 1))
  	{
  		ttystatus("Illegal cell value\n");
  		return;
--- 358,364 ----
  	}
  
  	if ((row <= 0) || (row > rowmax) || (col <= 0) || (col > colmax) ||
! 		((state != 0) && (state != 1)))
  	{
  		ttystatus("Illegal cell value\n");
  		return;
***************
*** 451,459 ****
  	if (maxcount)
  		ttyprintf(" -m%d", maxcount);
  	if (viewfreq)
! 		ttyprintf(" -v%d", viewfreq / VIEWMULT);
  	if (dumpfreq)
! 		ttyprintf(" -d%d %s", dumpfreq / DUMPMULT, dumpfile);
  	if (outputfile)
  		ttyprintf(" -o %s", outputfile);
  	ttyprintf("\n");
--- 451,459 ----
  	if (maxcount)
  		ttyprintf(" -m%d", maxcount);
  	if (viewfreq)
! 		ttyprintf(" -v%ld", viewfreq / VIEWMULT);
  	if (dumpfreq)
! 		ttyprintf(" -d%ld %s", dumpfreq / DUMPMULT, dumpfile);
  	if (outputfile)
  		ttyprintf(" -o %s", outputfile);
  	ttyprintf("\n");
***************
*** 747,753 ****
  
  	fp = fopen(file, "r");
  	if (fp == NULL) {
- 	CELL	**set;
  		ttystatus("Cannot open \"%s\"\n", file);
  		return ERROR;
  	}
--- 747,752 ----
*** search.c.OLD	Sun Oct  7 10:47:04 1990
--- search.c.NEW	Sun Oct  7 09:57:24 1990
***************
*** 1086,1091 ****
--- 1086,1095 ----
  			break;
  
  		case ON:
+ 			if ((OFFcount == 4) && (ONcount == 2))
+ 				flags |= N0ICUN1;
+ 			if ((OFFcount == 5) && (ONcount == 1))
+ 				flags |= N0ICUN0;
  			if (OFFcount == 6)
  				flags |= N1ICUN1;
  			if ((ONcount == 1) && (UNKcount == 1))
***************
*** 1097,1102 ****
--- 1101,1108 ----
  				flags |= (N1ICUN1 | N1IC1);
  			if ((ONcount == 2) && (UNKcount == 0))
  				flags |= (N0IC0 | N1IC1);
+ 			if ((ONcount == 2) && (OFFcount == 5))
+ 				flags |= (N0IC0 | N0ICUN0);
  			break;
  	}
  	if (UNKcount == 0)
END OF PATCHES
D



More information about the Alt.sources mailing list