Ken McLeod (thecloud@dhw68k.cts.com) asked:
>  Has anyone else on the net tried to implement the Hodgepodge
> algorithm described in the August issue of Scientific American
> (A. K. Dewdney's column)...?

To which I replied:
> [ Demonstrating a problem with the HP machine as originally described. ]
> . . .
> If there is sufficient demand for the source code, I'll post it generally,
> else I'll just send it to Ken.  
-- 
Raymond Chen	UUCP: ...allegra!princeton!{phoenix|pucc}!rjchen
		BITNET: rjchen@phoenix.UUCP, rjchen@pucc
		ARPA: rjchen@phoenix.PRINCETON.EDU, rjchen@pucc.PRINCETON.EDU
"Say something, please!  ('Yes' would be best.)" - The Doctor
Since I've now received several requests for the code, here it is.  But
first, a word from our sponsor:


[1]  This is written for Turbo C version 1.5 (although I'm fairly certain
	version 1.0 will also work).  If that's not what you have, read on.
[2]  If your compiler doesn't like the new ANSI-style declarations, 
	convert them to K&R-style.  It's not difficult; to make life
	simpler, I declared each function before using it (a la Pascal)
	so there is no need for explicit declarations.
[3]  Your compiler certainly will not like the kbhit(), gotoxy(), and
	clrscr() functions.  Convert them to the appropriate functions
	for your machine.  (kbhit() returns nonzero if a keypress is
	pending, the remaining two do what they say to the screen.)
[4]  You will definitely need to change the mrand() function.  Given
	an integer, it returns a pseudo-random number in the range
	0 .. n-1.  Please don't use (rand() % n) to reduce the range;
	it does unpleasant things if the generator is a linear congruence.
[5] If your compiler doesn't like memset(), then convert it to bzero().
[6]  You will probably dislike my programming style.  I'm a math major,
	not a computer scientist.
[7]  If the comments and code disagree, trust the code.  I scribbled this
	up in a half-hour one evening a long time ago, and (of course)
	didn't comment it.  The comments I have stuck in just now, 
	relying on my hazy memory for how I pulled this thing off.

