[comp.sources.d] rot2 - waterfall terminal display

bandy@amdcad.AMD.COM (Andy Beals) (05/26/87)

In article <6800001@cpe> tif@cpe.UUCP writes:
	    ^^^^^^^  down with notes!
>For equal portions of "water" to "fall" on each side of an obstacle
>the following change should be made to rot.c on line 395 (?):
>
>		else if(rand()&01000) {
>Should be
>		else if(rand()&1) {

Nope.  rand() doesn't give truely random numbers, just pseudo-random numbers.
Try writing a little program that prints the output of rand()&1 and note what
you get out.  Not random at all.
	andy
-- 
Andrew Scott Beals, {lll-crg,decwrl,allegra}!amdcad!bandy +1 408 749 3683

aad+@andrew.cmu.edu.UUCP (05/27/87)

Rand will give you a better random number if you use it in a real program,
not just inside a constant-time loop in a "little program"