DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T l

⟦4a17124ac⟧ TextFile

    Length: 1288 (0x508)
    Types: TextFile
    Names: »loctable.c«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Abermud/loctable.c« 

TextFile

#include "kernel.h"
#ifdef	RCSID
static char RCS[] =
	"$Header: loctable.c,v 1.1 89/03/13 09:36:43 rsalz Exp $";
#endif	/* RCSID */



convroom(x)
    int x;
{
    int ct;
    
    for (ct = 0; ; ct++) {
	if (x == -room_data[ct].r_code)
	    return ct;
	if (room_data[ct].r_code == 0)
	    return -9999;
    }
}

char *
sdesc(room)
    int room;
{
    if (!exists(room))
	return "Where no man has gone before";
    return room_data[convroom(room)].r_short;
}

char *
ldesc(room)
    int room;
{
    if (!exists(room))
	return "";
    return room_data[convroom(room)].r_long;
}

getexit(room, ex)
    int room, ex;
{
    return room_data[convroom(room)].r_exit[ex];
}

exists(room)
    int room;
{
    return convroom(room) != -9999;
}

locdir()
{
    int locnum;
    int posync;
    int i;
    char rt[32];
    char rs[32];
    int ct;
    
    if (plev(mynum) < 10) {
	bprintf("Sorry ... not allowed\n");
	return;
    }
    pbfr();
    for (locnum = 0, posync = 0, ct = 0; room_data[ct].r_code; ct++) {
	i = findzone(-room_data[ct].r_code, rt);
	sprintf(rs, "%s%d", rt, i);
	bprintf("%-11s", rs);
	locnum++;
	posync++;
	if (posync % 7 == 6)
	    bprintf("\n");
	if (posync % 32 == 0)
	    pbfr();
    }
    if (posync % 32)
	bprintf("\n");
    bprintf("Total of %d rooms.\n", locnum);
}