home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume5
/
wanderer
/
part02
/
read.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-07-05
|
536b
|
27 lines
#include "wand_head.h"
int rscreen(num,row_ptr,maxmoves)
int *maxmoves, num;
char (*row_ptr)[ROWLEN+1];
{
int y;
FILE *fp;
char name[50];
sprintf(name,"%s/screen.%d",SCREENPATH,num);
fp = fopen(name,"r");
if(fp == NULL)
printf("File for screen %d unavailable.\n\n",num) ;
else
{
for(y = 0;y<NOOFROWS;y++)
{
fgets((*row_ptr++),ROWLEN + 1,fp);
fgetc(fp); /* remove newline char*/
};
if(fscanf(fp,"%*s\n%d",maxmoves) != 1)
*maxmoves=0;
};
fclose(fp);
return (fp == NULL);
}