Below is the full text to rnd.c from the source code of Hack 1.0. To link to a particular line, write [[Hack 1.0/rnd.c#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code.

The Usenet post in which this file was originally distributed is not archived at Google Groups. No copy is known to be publicly available. This file is reconstructed from later versions and may not match the original distribution exactly.

Screenshots and source code from Hack are used under the CWI license.
1.    #define RND(x)	((rand()>>3) % x)
3.    rn1(x,y)
4.    register int x,y;
5.    {
6.    	return(RND(x)+y);
7.    }
9.    rn2(x)
10.   register int x;
11.   {
12.   	return(RND(x));
13.   }
15.   rnd(x)
16.   register int x;
17.   {
18.   	return(RND(x)+1);
19.   }
21.   d(n,x)
22.   register int n,x;
23.   {
24.   	register int tmp = n;
26.   	while(n--) tmp += RND(x);
27.   	return(tmp);
28.   }

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.