home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / games / volume5 / wanderer / part02 / read.c < prev    next >
C/C++ Source or Header  |  1988-07-05  |  536b  |  27 lines

  1. #include "wand_head.h"
  2.  
  3. int rscreen(num,row_ptr,maxmoves)
  4. int *maxmoves, num;
  5. char (*row_ptr)[ROWLEN+1];
  6. {
  7. int  y;
  8. FILE *fp;
  9. char name[50];
  10. sprintf(name,"%s/screen.%d",SCREENPATH,num);
  11. fp = fopen(name,"r");
  12. if(fp == NULL)
  13.     printf("File for screen %d unavailable.\n\n",num) ;
  14. else
  15.     {
  16.     for(y = 0;y<NOOFROWS;y++)
  17.         {
  18.         fgets((*row_ptr++),ROWLEN + 1,fp);
  19.     fgetc(fp);                         /* remove newline char*/
  20.     };
  21.     if(fscanf(fp,"%*s\n%d",maxmoves) != 1)
  22.     *maxmoves=0;
  23.     };
  24. fclose(fp);
  25. return (fp == NULL);
  26. }
  27.