MCPcopy Create free account
hub / github.com/NetHack/NetHack / init_fill

Function init_fill

src/mkmap.c:36–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36staticfn void
37init_fill(schar bg_typ, schar fg_typ)
38{
39 coordxy x, y;
40 long limit, count;
41
42 limit = (WIDTH * HEIGHT * 2) / 5;
43 count = 0;
44 while (count < limit) {
45 x = (coordxy) rn1(WIDTH - 1, 2);
46 y = (coordxy) rnd(HEIGHT - 1);
47 if (levl[x][y].typ == bg_typ) {
48 levl[x][y].typ = fg_typ;
49 count++;
50 }
51 }
52}
53
54staticfn schar
55get_map(coordxy col, coordxy row, schar bg_typ)

Callers 1

mkmapFunction · 0.85

Calls 1

rndFunction · 0.85

Tested by

no test coverage detected