markov3, roll(n) patch

jrb at petro.UUCP jrb at petro.UUCP
Sat Feb 21 05:41:37 AEST 1987


I had a couple of problems with the patches posted to net.sources for the
markov3.l program.  The patches stopped the core dumps but I found that the
bit-wise operations happening in the roll(n) function were causing WAY too
much duplication on the machine I am using (Tandy 6000, XENIX 3.01.02).  As
the roll(n) function is just supposed to return a random number between 0 and
n-1 I have applied the following fix using the % operator.  My markov3.l works
great if line 377 reads like:

	return(rand() % n);

This is a great program (although it's a memory piggy)... thanks!
-- 
Jon Boede				...!{ihnp4,akgua,gatech}!petro!jrb
512/599-1847				2555 N.E. Loop 410, #1403, 78217
	"People who are incapable of making decisions are
	 the ones who hit those barrels at freeway exits."



More information about the Comp.sources.bugs mailing list