1: /* rnd.c - version 1.0.2 */
2:
3: #define RND(x) ((rand()>>3) % x)
4:
5: rn1(x,y)
6: register x,y;
7: {
8: return(RND(x)+y);
9: }
10:
11: rn2(x)
12: register x;
13: {
14: return(RND(x));
15: }
16:
17: rnd(x)
18: register x;
19: {
20: return(RND(x)+1);
21: }
22:
23: d(n,x)
24: register n,x;
25: {
26: register tmp = n;
27:
28: while(n--) tmp += RND(x);
29: return(tmp);
30: }
Defined functions
d
defined in line
23; used 42 times
- in /usr/src/games/hack/hack.bones.c line
47
- in /usr/src/games/hack/hack.dog.c line
351
- in /usr/src/games/hack/hack.eat.c line
166-169(2)
- in /usr/src/games/hack/hack.fight.c line
53,
151
- in /usr/src/games/hack/hack.makemon.c line
57
- in /usr/src/games/hack/hack.mhitu.c line
42,
62-66(2),
78-79(2),
130,
139-142(2),
157,
210-211(2),
220-222(2),
230,
272-273(2),
308
- in /usr/src/games/hack/hack.mon.c line
311,
423
- in /usr/src/games/hack/hack.potion.c line
33,
157
- in /usr/src/games/hack/hack.shk.c line
800,
926
- in /usr/src/games/hack/hack.steal.c line
199
- in /usr/src/games/hack/hack.trap.c line
68,
82
- in /usr/src/games/hack/hack.wizard.c line
73
- in /usr/src/games/hack/hack.worm.c line
158
- in /usr/src/games/hack/hack.zap.c line
29,
484-489(2),
499,
551-556(2),
564
rn1
defined in line
5; used 25 times
- in /usr/src/games/hack/hack.apply.c line
280
- in /usr/src/games/hack/hack.fight.c line
351
- in /usr/src/games/hack/hack.makemon.c line
36,
171
- in /usr/src/games/hack/hack.mhitu.c line
82
- in /usr/src/games/hack/hack.mklev.c line
51
- in /usr/src/games/hack/hack.mkmaze.c line
63-67(2),
73-81(3)
- in /usr/src/games/hack/hack.mkobj.c line
64,
99
- in /usr/src/games/hack/hack.mon.c line
577-579(2)
- in /usr/src/games/hack/hack.potion.c line
52,
72,
113,
121,
141,
148
- in /usr/src/games/hack/hack.trap.c line
127
- in /usr/src/games/hack/hack.zap.c line
147,
417,
602
rn2
defined in line
11; used 277 times
- in /usr/src/games/hack/hack.apply.c line
91-93(2),
263
- in /usr/src/games/hack/hack.bones.c line
19,
33,
77
- in /usr/src/games/hack/hack.c line
146
- in /usr/src/games/hack/hack.cmd.c line
257
- in /usr/src/games/hack/hack.do.c line
199,
215-219(2),
354,
368,
420-424(2)
- in /usr/src/games/hack/hack.do_name.c line
199-201(3)
- in /usr/src/games/hack/hack.do_wear.c line
316-318(3)
- in /usr/src/games/hack/hack.dog.c line
154-155(3),
169-170(3),
200,
236-238(2),
280,
289-290(2),
330,
336-339(3),
386
- in /usr/src/games/hack/hack.eat.c line
65,
150,
162-171(4),
204,
242,
306,
365-371(3),
379,
406
- in /usr/src/games/hack/hack.engrave.c line
63-68(2)
- in /usr/src/games/hack/hack.fight.c line
54,
72,
102,
158,
261,
310,
326-328(2),
339-354(6)
- in /usr/src/games/hack/hack.invent.c line
795
- in /usr/src/games/hack/hack.main.c line
304-307(2),
339
- in /usr/src/games/hack/hack.makemon.c line
34-35(2),
82-87(2),
148,
172
- in /usr/src/games/hack/hack.mhitu.c line
22,
69,
75,
93,
105,
118-120(2),
129,
162,
168,
183,
194,
205-208(2),
217,
227,
250-255(2),
266,
296,
345
- in /usr/src/games/hack/hack.mklev.c line
62,
69,
85-95(5),
110,
118,
126-134(5),
157-161(2),
171-172(2),
181,
192-193(2),
289-290(2),
334,
385,
403,
453-455(3),
520,
528-531(2),
625-628(3),
638,
650-654(3),
675,
682-683(2),
689-695(3),
715-716(2),
736
- in /usr/src/games/hack/hack.mkmaze.c line
65,
98,
133-134(2)
- in /usr/src/games/hack/hack.mkobj.c line
34,
65-66(2),
80,
90-92(3),
104,
110
- in /usr/src/games/hack/hack.mkshop.c line
69,
125-129(2),
147,
156-158(2),
179-183(2),
189,
199(2),
213,
226
- in /usr/src/games/hack/hack.mon.c line
165-166(2),
183-186(3),
195-198(2),
206,
214,
220-223(4),
261,
289-292(3),
305-310(2),
318,
395,
407,
418,
435,
572,
754-758(2)
- in /usr/src/games/hack/hack.o_init.c line
55,
67
- in /usr/src/games/hack/hack.objnam.c line
513,
538-539(2)
- in /usr/src/games/hack/hack.potion.c line
17,
36,
230,
243-248(2),
281,
292
- in /usr/src/games/hack/hack.read.c line
47,
145,
323(2),
336,
367
- in /usr/src/games/hack/hack.rumors.c line
47
- in /usr/src/games/hack/hack.search.c line
63,
69,
83
- in /usr/src/games/hack/hack.shk.c line
146,
174,
386,
906,
922
- in /usr/src/games/hack/hack.steal.c line
15,
21,
81
- in /usr/src/games/hack/hack.trap.c line
43,
57,
89,
103,
145,
153,
272-273(2),
300,
393,
431-436(2)
- in /usr/src/games/hack/hack.u_init.c line
157,
201-206(3),
218,
237-238(2)
- in /usr/src/games/hack/hack.wield.c line
84,
92
- in /usr/src/games/hack/hack.wizard.c line
24,
69-74(2),
103-107(2),
113-123(4),
130,
173,
186
- in /usr/src/games/hack/hack.worm.c line
141
- in /usr/src/games/hack/hack.zap.c line
49,
128,
158(2),
167,
215,
371,
430,
490,
512,
521,
603,
616
rnd
defined in line
17; used 134 times
- in /usr/src/games/hack/hack.apply.c line
93-98(2)
- in /usr/src/games/hack/hack.c line
86,
758
- in /usr/src/games/hack/hack.do.c line
197-201(2),
214,
221,
295,
346,
364
- in /usr/src/games/hack/hack.eat.c line
70,
77,
176,
240,
375-376(2),
382
- in /usr/src/games/hack/hack.fight.c line
25,
115,
139,
147-154(4),
169-172(2),
201,
222,
318,
328,
341
- in /usr/src/games/hack/hack.invent.c line
795
- in /usr/src/games/hack/hack.main.c line
329
- in /usr/src/games/hack/hack.makemon.c line
56,
98
- in /usr/src/games/hack/hack.mhitu.c line
39,
69,
80-81(2),
115,
131-132(2),
150,
164-169(2),
175-183(5),
204,
215-216(2),
233-234(2),
258-263(4),
291-293(3),
299,
313,
351
- in /usr/src/games/hack/hack.mklev.c line
117,
403,
604
- in /usr/src/games/hack/hack.mkobj.c line
65-68(2),
76,
91-93(2),
106-107(2),
136(2)
- in /usr/src/games/hack/hack.mkshop.c line
115
- in /usr/src/games/hack/hack.mon.c line
202,
214(2),
237,
731-732(2)
- in /usr/src/games/hack/hack.potion.c line
38,
61,
114,
126,
168,
196,
237,
317,
324-332(3)
- in /usr/src/games/hack/hack.read.c line
89,
145,
387
- in /usr/src/games/hack/hack.shk.c line
695-720(9),
726-734(4)
- in /usr/src/games/hack/hack.steal.c line
9(2)
- in /usr/src/games/hack/hack.trap.c line
50,
73,
102,
129,
299
- in /usr/src/games/hack/hack.u_init.c line
189(2),
196-197(2)
- in /usr/src/games/hack/hack.wizard.c line
141,
158
- in /usr/src/games/hack/hack.worm.c line
50-51(2),
121
- in /usr/src/games/hack/hack.zap.c line
28,
43,
372,
461,
478,
494
Defined macros
RND
defined in line
3; used 4 times