static char sccsid
[] = " zork.c 4.1 82/10/24 ";
* Dungeon - open UP dungeon
308, /* gedeon (watch him closely!) */
for (up
=users
; *up
; up
++)
printf("You are not a Wizard!\n");
* open up files needed by program
* look in current directory first, then try default names
* The following files must be as follows:
* "dtext.dat" open read-only on fd 3
* "dindex.dat open read-only on fd 4 (maybe this file isn't used)
* "doverlay" open read-only on fd 5 (put this file on fast disk)
if ((fd3
= open("dtext.dat", 0)) < 0)
if ((fd3
= open("/usr/games/lib/dtext.dat", 0)) < 0)
error("Can't open dtext.dat\n");
if ((fd4
= open("dindex.dat", 0)) < 0)
if ((fd4
= open("/usr/games/lib/dindex.dat", 0)) < 0)
error("Can' open dindex.dat\n");
if ((fd5
= open("doverlay", 0)) < 0)
if ((fd5
= open("/tmp/nedtmp/doverlay", 0)) < 0)
if ((fd5
= open("/usr/games/lib/doverlay", 0)) < 0)
error("Can't open doverlay\n");
if (fd3
!= 3 || fd4
!= 4 || fd5
!= 5)
error("Files opened on wrong descriptors\n");
printf("You are in an open field west of a big white house with a boarded\n");
printf("There is a small mailbox here.\n>");
execl("dungeon","zork", 0);
execl("/usr/games/lib/dungeon","zork", 0);
if( (uid
=open("dungeon", 0)) > 0 ) {
execlp("compat", "zork", "dungeon", 0);
execlp("/usr/games/lib/compat", "zork", "dungeon", 0);
execlp("compat", "zork", "/usr/games/lib/dungeon", 0);
execlp("/usr/games/lib/compat", "zork", "/usr/games/lib/dungeon", 0);
printf("Can't start dungeons.\n");