Hi everyone. I just finished creating a program similar to minesweeper, but it's called miensfeld. The rule of the game are stated in the intro of the program. I was just wondering if anyone would mind checking it out for me? I just can't seem to compile it. But please bare with me. It consists of several files but I commented it well, so it shouldn't be too hard to understand.

/* File: main.c */
#include "tfdef.h"
#include "movement.h"
#include "game_utils.h"
#include "display.h"
#include "menus.h"
#include "mine.h"

main()
{
  int difficulty, want_play, games, points, win;
  points = games = win = 0;	

  /* Intro */
  want_play = text_intro();

  /* While user wants to play */
  while(want_play)
    {	
      /* Difficulty */
      difficulty = diffselect();
		
      /* Play the game and sum up total points*/
      points += mine_game(difficulty, &win);

      /* Ask play again */
      want_play = retry_game();

      /* Increment rounds */
      games++;
    }

  printf("You played %d games", games);
  printf(" and scored %d points\n", points);
  printf("Wins: %d   Loses: %d\n", win, games - win);
  printf("Win per game ratio is %.2f\n\n", (float)win / games);
}
/* File: mine.c */
#include "tfdef.h"
#include "game_utils.h"
#include "movement.h"
#include "display.h"
#include "menus.h"
#include "mine.h"

int mine_game(int difficulty, int *win)
{
   int field[MAX_ROW][MAX_COL];
   short point_tracker, flag_tracker;
   char ch;
   int row, col, prow, pcol,  
   flags, mines, pointsum,
   i, j;
   int want_play = TRUE;
  
   /* Initialize variables */
   row = col = pointsum = 0;
   point_tracker = UNMOVED;
   mines = flags = difficulty;

   /* Gives a random field according to difficulty*/
   randomize_field(field, difficulty);

   /* Gives a random number of safe spots */
   randomize_safe_spots(field);

   /* Gives a field */
   draw_board();

   /* Prints mine and field counter */
   update_flags(flags);
   update_mines(mines);

   /* Print setting*/
   switch(difficulty)
     {	
       case EASY      :write_message(2, "Easy");
       break;			
       case MODERATE  :write_message(2, "Moderate");
       break;
       case HARD      :write_message(2, "Hard");
       break;
       case IMPOSSIBLE:write_message(2, "Impossible");
       break;
       default        :write_message(2, "Easy");
     }

   /* Fix first three columns for safe spots */
   for(i = 0; i < MAX_ROW; i++)
   for(j=0; j < 3; j++)
      {
	if(field[i][j] == SAFE_KNOWN)
	show_glif(SAFE, i, j, probe(field, i, j));
      }

    /* Print player in top left corner */
    show_glif(TIMMY, 0, 0, 0);
	
    /* While user not dead or didn't won get input */
    while(ch = getchar()) 
      {
	/* If input is move keep track of where he should move */
	if(is_move(ch))
          {
            /* Move */
	    point_tracker = tim_move(ch, &row, &col, field);

	    /* Update points */
	    points(point_tracker, &pointsum);		
	    if(point_tracker == WINNER || point_tracker == MOVED_MINE)
	    break;
          }

	/* Else if it's input is to plant a flag, and have flags to plant */
	else if(is_flag(ch) && flags > 0)
	  {
	    /* Plant flag */
	    point_tracker = plant_flag(ch, &row, &col, &prow, &pcol, &mines, field);

	    /* Update */
	    points(point_tracker, &pointsum);

	    /* Decrease amount of flags */
	    update_flags(--flags);

	  }
		
	/* Else character is not real, discard */
	else
	continue;

      }
	
    /* Clean out difficulty text */
    write_message(2, "           ");

    /* Show all mines left */
    for(i = 0; i < MAX_ROW; i++)
    for(j = 0; j < MAX_COL; j++)
    if(field[i][j] == FIELD_MINE)
    show_glif(MINE, i, j, 0);

    /* If you won */
    if(point_tracker == WINNER)
    {	
      write_message(9, "Good Job!");

      /* Increment wins */
      ++*win;
    }
  /* Otherwise lose */
  else
    {
      /* Make sound */
      printf("\a");

      /* Print message */
      write_message(9, "Whoops!");
		
      /* Show where exploded */
      show_glif(EXPLODE, row, col, 0);
    }

  /* Return total points */
  return pointsum;
}
/* File: menus.c */
#include "menus.h"
#include <stdio.h> 
#include "tfdef.h"

int text_intro(void)
{ 
  /* Declare Variable */ 
  int n;

  /* Print menu */
  print_menu(n);

  /* Get input */
  printf("enter choice: ");

  /* While given int */
  while(scanf("%d", &n) == 1) 
    {       
	/* If user wants to play quit this intro */
	if(n == PLAY_GAME) return TRUE;

	/* Else print help */
	else print_menu(n);
            
        printf("enter choice: ");
    }
  printf("Invalid Input. Quitting.\n");
  return FALSE;
}

void print_menu(int n)
{
  FILE *in;
  int key;

  /* Select from menus and open file */	
  switch(n)
    { 
      case 1: in = fopen("move", "r");
      break;
      case 2: in = fopen("flags", "r");
      break;
      case 3: in = fopen("points", "r");
      break;
      case 4: in = fopen("level", "r");
      break; 
      default: in = fopen("title1", "r");
      break;
    }
  putchar('\n');
  /* While still characters to be read */
  while ((key = fgetc(in)) != EOF)
  /* Print each one */
  putchar(key);

  /* Close file */
  fclose(in);
}

int diffselect(void)
{
  char ch;
  print_menu(PLAY_GAME);
  printf("enter choice: ");

  do
  ch = getchar();
  while(ch != '1' && ch != '2' && ch != '3' && ch != '4');
		
  /* Choose your fate */			
  switch(ch)
    {
      case '1': return EASY;
      case '2': return MODERATE;
      case '3': return HARD;
      case '4': return IMPOSSIBLE;
      default : return EASY;
    }
}


int retry_game(void)
{	
  char ch, retry;

  write_message(10, "Play again?");
  while(TRUE)
    {
      scanf("%c", &retry);
      if(retry == 'y' || retry =='Y')
	{
	  write_message(11, "YES");
	  write_message(13, "Difficulty?");
	  write_message(14, "1. Easy");
	  write_message(15, "2. Moderate");
	  write_message(16, "3. Hard");
	  write_message(17, "4. Impossible");
	  return TRUE;	
	}	
      else if(retry == 'n' || retry =='N')
	{
	  clear_screen();
	  return FALSE;
	}
      else
	continue;
    }
}

void clear_screen()
{printf("\n");
}
/* File: movement.c */

#include "display.h"
#include "movement.h"
#include "tfdef.h"
#include "game_utils.h"
#include "mine.h"

int is_flag(char ch)
{
  switch(ch)
    {  
       case 'Y':  
       case 'U':  
       case 'I':  
       case 'H':  
       case 'K':  
       case 'N': 
       case 'M':
       case '<': return TRUE;
       default : return FALSE;
     }
}

int is_move(char ch)
{
  switch(ch)
    { 
      case 'y':
      case 'u':
      case 'i':
      case 'h':
      case 'k':
      case 'n':
      case 'm':
      case ',': return TRUE;
      default : return FALSE;
    }
}

int tim_move(char ch, int *row, int *col, int field[][MAX_COL])
{                        
  /* This keeps user from moving outside the field and cheating */
	
     if(*row == LOWER_LIM && (ch=='y' || ch=='u' || ch=='i')) return UNMOVED;
     if(*row == LIM_ROW && (ch=='n' || ch=='m' || ch==',')) return UNMOVED;
     if(*col == LOWER_LIM && (ch=='y' || ch=='h' || ch=='n')) return UNMOVED;

     /* If in the last col and move to the right, return winner */
     if(*col == LIM_COL && (ch=='i' || ch=='k' || ch=='.')) return WINNER;

     /* If in a spot with flag */
     if (field[*row][*col] == FLAGGED_SAFE)
       show_glif(FLAG, *row, *col, 0);

     /* Else if in spot with flag on mine */
     else if (field[*row][*col] == FLAGGED_MINE)
       show_glif(FL_MINE, *row, *col, 0);

     /* Else you are in safe field */
       else
	 show_glif(SAFE, *row, *col, probe(field, *row, *col));

     /* according to the char you entered, moves you accordingly */
     switch(ch)
       { 
	 case 'y': --*col;
	   --*row;
	   break;
	 case 'i': ++*col;
	   --*row;
	   break;
	 case 'n': --*col;
	   ++*row;
	   break;
	 case ',': ++*col;
	   ++*row;
	   break;
	 case 'k': ++*col;
	   break;
	 case 'h': --*col;
	   break;
	 case 'm': ++*row;
	   break;
	 case 'u': --*row;
	   break;
	 default : break;
       }

     /* If stepped on mine, dead */
     if(field[*row][*col] == FIELD_MINE || field[*row][*col] == FLAGGED_MINE)
       return MOVED_MINE;

     /* Else show current location */
       else show_glif(TIMMY, *row, *col, probe(field, *row, *col));

     /* If moved into safe_unknown */	
     if(field[*row][*col] == SAFE_UNKNOWN)
       {
	 field[*row][*col] = SAFE_KNOWN;
	 return MOVED_NEW;
       }
     /* Else return moved */
     else return MOVED;
}


int plant_flag(char ch, int *row, int *col, int *prow, int *pcol, int *mines, int field[][MAX_COL])
{                        
  /* Same as above and makes it so you can discard flag */ 
  if(*row == LOWER_LIM && (ch=='Y' || ch=='U' || ch=='I')) return;
  if(*row == LIM_ROW && (ch=='N' || ch=='M' || ch=='<')) return;
  if(*col == LOWER_LIM && (ch=='Y' || ch=='H' || ch=='N')) return;
  if(*col == LIM_COL && (ch=='I' || ch=='K' || ch=='<')) return;

  /* Set cur loc to used mine loc */
    *prow = *row;
    *pcol = *col;

  /* Where you will use flag */
  switch(ch)
    { 
      case 'Y': --*pcol;
        --*prow;
        break;
      case 'I': ++*pcol;
        --*prow;
        break;
      case 'N': --*pcol;
        ++*prow;
        break;
      case '<': ++*pcol;
        ++*prow;
	break;
      case 'K': ++*pcol;
        break;
      case 'H': --*pcol;
	break;
      case 'M': ++*prow;
	break;
      case 'U': --*prow;
        break;
      default : break;
    } 
  /* If using flag where there is a mine */
  if(field[*prow][*pcol] == FIELD_MINE)
    {
      /* Store as used mine */
      field[*prow][*pcol] = FLAGGED_MINE;

      /* Show on screen */
      show_glif(FL_MINE, *prow, *pcol, 0);

      /* Increment counter */
      update_mines(--*mines);

      /* Return as used mine */
      return FLAG_MINE;
    }
  /* Else mine used on safe area */
  else
    {
      /* Used flag on safe area */
      field[*prow][*pcol] = FLAGGED_SAFE;

      /* Show on screen */
      show_glif(FLAG, *prow, *pcol, 0);

      /* Return as planted on safe area */
      return FLAG_SAFE;
    }
}
/* File: game_utils.c */
#include "game_utils.h"

void randomize_field(int a[][MAX_COL], int max_mines)
{
  int row, col, spot;

  /* Seed the randomization to time */
  SEED_RAND;

  /* Start field of as safe */
  for(col=0; col < MAX_COL; col++)
  for(row=0; row < MAX_ROW; row++)
    a[row][col] = SAFE_UNKNOWN;
	
  /* While, add mines */
  while(max_mines > 0)
    {
      for(row=0; row < MAX_ROW; row++)
      for(col=2; col < MAX_COL; col++)
        {
	  /* Randomly makes new field with mines and safe spots */
          spot = GEN_MINE;

          /* If mines is > or = or < */
          if(max_mines > 0 && spot == FIELD_MINE && a[row][col] != FIELD_MINE)
            {
	      /* Store mine */
	      a[row][col] = FIELD_MINE;

	      /* Fix counter */
	      max_mines--;
            }
	}
    }			
}

void randomize_safe_spots(int a[][MAX_COL])
/* Given: A randomized 2D array */
/* Returns: Randomizes first three cols for safe spots. */
{
  int row, col;
  int third_col = 0;

  /* First col safe */
  for(row=col=0; row < MAX_ROW; row++)
    a[row][col] = SAFE_KNOWN;

  /* In third col, check for safe areas*/
  col = 2;
  for(row=0; row < MAX_ROW; row++)
    if(a[row][col] == SAFE_UNKNOWN) third_col++;
  
  /* If safe areas greater than max random safe areas */
  if(third_col > MAX_SAFE) third_col = MAX_SAFE;

  /* Put safe spots */
  for(row=0; row < MAX_ROW && third_col > 0; row++)
  if(a[row][col] == SAFE_UNKNOWN)
    {
      a[row][col] = SAFE_KNOWN;
      third_col--;
    }

  /* Second col is based on third */
  for(row=0; row < MAX_ROW; row++)

  /* If the block in 3 col is safe, then */ 
  if(a[row][col] == SAFE_KNOWN)
    {
      /* If . . . put safe area in next upper left corner */
      if(row > LOWER_LIM)
      a[row-1][col-1] = SAFE_KNOWN;

      /* If . . .  put safe area next bottom left corner */
      if(row < LIM_ROW)
      a[row+1][col-1] = SAFE_KNOWN;

      /* Put safe area in the next left */
      a[row][col-1] = SAFE_KNOWN;
    }
}

int probe(int a[][MAX_COL], int row, int col)
{
  int around = 0;

  /* If landed on mine, return BOOM */
  if(a[row][col] == FIELD_MINE || a[row][col] == FLAGGED_MINE)
  return BOOM;

  /* Make sure field has mines and fix counter if mines flagged */
  if(a[row+1][col] == FIELD_MINE || a[row+1][col] == FLAGGED_MINE)
    around++;

  if(a[row+1][col+1] == FIELD_MINE || a[row+1][col+1] == FLAGGED_MINE)
    around++;

  if(col != 0)
  if(a[row+1][col-1] == FIELD_MINE || a[row+1][col-1] == FLAGGED_MINE)
    around++;

  if(row != 0)
  if(a[row-1][col] == FIELD_MINE || a[row-1][col] == FLAGGED_MINE)
    around++;

  if(row != 0)
  if(a[row-1][col+1] == FIELD_MINE || a[row-1][col+1] == FLAGGED_MINE)
    around++;

  if(row != 0 && col != 0)
  if(a[row-1][col-1] == FIELD_MINE || a[row-1][col-1] == FLAGGED_MINE)
    around++;

  if(a[row][col+1] == FIELD_MINE || a[row][col+1] == FLAGGED_MINE)
    around++;

  if(col != 0)
  if(a[row][col-1] == FIELD_MINE || a[row][col-1] == FLAGGED_MINE)
    around++;

  /* Return new number around mines */
  return around;
}

void points(int loc, int *score)
{
  switch(loc)
    {
      case MOVED_NEW: update_score(*score += 1);
	break;
      case FLAG_MINE: update_score(*score += 2);
	break;
      case FLAG_SAFE: update_score(*score -= 1);
	break;
	case WINNER   : update_score(*score += 10);
      default       : break;
    }
}
/* File: display.c 
 * This file contains the implementation for the display module for the
 * miensfeld game.
*/
#include "datatype.h"
#include "display.h"
#include "game_utils.h"

void init_display(void)
{
  initscr();             /* initialize the curses library */
  keypad(stdscr, TRUE);  /* enable keyboard mapping */
  cbreak();              /* take input chars one at a time, no wait for \n */
  noecho();              /* don't echo input */
  /* Optional - attempt to get rid of the cursor */
  curs_set(0);           /* try to make the cursor invisible */
  mvaddch(23,79,' ');    /* move cursor to lower right corner */
  refresh();             /* update screen */
  leaveok(stdscr, TRUE); /* leave the cursor at (23,79) */
}

void reset_display(void)
{
  endwin();              /* terminate window */
}

void disp_intro(void)
{
  clear();               /* clear display */
  printw(                /* printf() in curses */
    "\t\t\t\t WELCOME\n"
    "\t\t\t\t   to\n"
    "\t\t\t\tMiensfeld\n"
    "\n"
    "\tYou are about to be placed in grave danger.  You are being sent\n"
    "\tinto the Miensfeld, a field full of mines.  Your mission is to\n"
    "\tfind your way to the other side without blowing yourself up, and\n"
    "\tmap the field in the process. Your predecessors have already mapped\n"
    "\tpart of the field for you before meeting their untimely ends.  You\n"
    "\tdo have a few tools to help you.  Your proximity probe will\n"
    "\tdisplay how many mines are in your immediate area as you step into\n"
    "\teach grid on the field.  You also carry a set of flags you can\n"
    "\tplant to show grids where you suspect there might be a mine.  For\n"
    "\tmore information, or to begin, choose from the menu below:\n"
  );
  disp_menu();
}

void disp_move(void)
{
  clear();
  printw(
    "\t\t\t\tMoving About\n"
    "\n"
    "\tYou can move about the field in any of eight directions from\n"
    "\tyour current position by using the keys centered around the 'j'\n"
    "\tkey:\n"
    "\n"
    "\t\t\t\ty | u | i\n"
    "\t\t\t\t--|---|--\n"
    "\t\t\t\th |   | k\n"
    "\t\t\t\t--|---|--\n"
    "\t\t\t\tn | m | ,\n"
    "\n"
    "\tHowever, you will not be allowed to leave the field except from\n"
    "\tthe far right edge.\n"
  );
  disp_menu();
}

void disp_flag(void)
{
  clear();
  printw(
    "\t\t\t\tPlanting Flags\n"
    "\n"
    "\tYou can plant one of your flags in any of eight directions from\n"
    "\tyour current position by using the shifted keys centered around\n"
    "\tthe 'J' key:\n"
    "\n"
    "\t\t\t\tY | U | I\n"
    "\t\t\t\t--|---|--\n"
    "\t\t\t\tH |   | K\n"
    "\t\t\t\t--|---|--\n"
    "\t\t\t\tN | M | <\n"
    "\n"
    "\tYou will receive 2 points if you plant a flag on a mine, but you\n"
    "\twill lose 1 point (and the flag) if you plant it in an empty grid.\n"
  );
  disp_menu();
}

void disp_point(void)
{
  clear();
  printw(
    "\t\t\t\t Earning Points\n"
    "\n"
    "\tYou earn 1 point for each new \"SAFE\" grid you identify by stepping\n"
    "\tthrough it.  You also get a bonus of 10 points for making it\n"
    "\tthrough the miensfeld by stepping out on the far right.  You also\n"
    "\tcan earn points for flags. You get 2 points for correctly flagging\n"
    "\ta mine, but you lose 1 point for incorrectly flagging a \"SAFE\" grid.\n"
    "\n"
    "\tThe game ends when you either blow up :-( or safely make it out of\n"
    "\tthe miensfeld on the far right :-)\n"
  );
  disp_menu();
}

void disp_menu(void)
{
  move(16,0);            /* start on line 17 */
  printw(
    "\t\t1)\tto find how to move about\n"
    "\t\t2)\tto find how to plant flags\n"
    "\t\t3)\tto see how to earn points\n"
    "\t\t4)\tto start play\n"
  );
}

void disp_level(void)
{
  clear();
  move(4,0);             /* start on line 5 */
  printw(
    "\tChoose your level of difficulty:\n"
    "\n"
    "\t\t1)\tEasy\n"
    "\t\t2)\tModerate\n"
    "\t\t3)\tHard\n"
    "\t\t4)\tImpossible\n"
  );
}

char getkey(void)
{
  return getch();        /* return key pressed */
}

void draw_board(void)
/* Note: need to replace magic numbers with names */
{
  int x, y;
  clear();
  /* print the board */
  for (y=0;y<23+0;y++)
  {
    for (x=25;x<25+39;x++)
    {
      if( (y+1)%3 == 0 )
        mvaddch(y,x,'-');
      if( (x-25+1)%4 == 0 )
        mvaddch(y,x,'|');
      }
  }
  /* place counter labels */
  mvaddstr(1+0,25+39+5,"MINES");
  mvaddstr(8+0,25+39+5,"FLAGS");
  mvaddstr(15+0,25+39+5,"SCORE");
  /* display counter initial reset - optional */
  update_mines(0);
  update_flags(0);
  update_score(0);
}

void update_mines(int num)
{
  show_digit((num/10)%10,2+0,25+39+4);
  show_digit(num%10,2+0,25+39+9);
}

void update_flags(int num)
{
  /*  Declaration of Variables  */
  int i, j;

  /*  Breaking down the number of flags into two separate digits  */
  i = num % 10;
  j = (num / 10) % 10;

  /*  Displaying the number of flags with two digits even if only one digit  */
  show_digit(j, 8 + 1, 25 + 39 + 4);
  show_digit(i, 8 + 1, 25 + 39 + 9);
}

void update_score(int num)
{
  show_digit((num/10)%10,16+0,25+39+4);
  show_digit(num%10,16+0,25+39+9);
}

void show_digit(int dig, int y, int x)
{
  switch(dig)
  {
    case 0:
      put_digit(y,x," _ | ||_|");
      break;
    case 1:
      put_digit(y,x,"    |  | ");
      break;
    case 2:
      put_digit(y,x," _  _||_ ");
      break;
    case 3:
      put_digit(y,x," _  _| _|");
      break;
    case 4:
      put_digit(y,x,"   |_|  |");
      break;
    case 5:
      put_digit(y,x," _ |_  _|");
      break;
    case 6:
      put_digit(y,x,"   |_ |_|");
      break;
    case 7:
      put_digit(y,x," _   |  |");
      break;
    case 8:
      put_digit(y,x," _ |_||_|");
      break;
    case 9:
      put_digit(y,x," _ |_|  |");
      break;
    default:
      break;
  }
}

void put_digit(int y, int x, char *c)
/* NOTE: magic numbers to be replaced */
{
  int i,j;
  move(y,x);
  for( i = 0; i < 3; i++)
  {
    for( j = 0; j < 3; j++)
      addch(c[i*3+j]);
    move(++y, x);
  }
}

void show_glif(unsigned char glif, int row, int col, int Adj_count)
{
  int y,x;
  /* translate row and col to x and y */
  y = row*3+0;
  x = col*4+25;
  switch(glif)
  {
    case TIMMY:
      put_glif(y,x," o  Y ",TRUE);
      if(Adj_count > 0 && Adj_count < 8)
        mvaddch(y+1,x+2,Adj_count+'0');
      break;
    case SAFE:
      put_glif(y,x,"   S  ",TRUE);
      if(Adj_count > 0 && Adj_count < 8)
        mvaddch(y+1,x+2,Adj_count+'0');
      break;
    case EMPTY:
      put_glif(y,x,"      ",TRUE);
      break;
    case FLAG:
      put_glif(y,x," P  | ",TRUE);
      if(Adj_count > 0 && Adj_count < 8)
        mvaddch(y+1,x+2,Adj_count+'0');
      break;
    case MINE:
      put_glif(y,x," ^ ***",TRUE);
      break;
    case FL_MINE:
      put_glif(y,x," P ***",TRUE);
      break;
    case EXPLODE:
      put_glif(y,x,"`!o-*-",TRUE);
      beep();
      break;
    default:
      break;
  }
}

void put_glif(int y, int x, char *c, int putspace)
/* NOTE: magic numbers to be replaced */
{
  int i,j;
  move(y,x);
  for( i = 0; i < 2; i++)
  {
    for( j = 0; j < 3; j++)
    {
      if(c[i*3+j] != ' ' || putspace)
        mvaddch(y+i,x+j,c[i*3+j]);
    }
  }
}

void write_message(int line, char *msg)
{
  int i,j;
  i = j = 0;
  move(line,0);
  while(j < 25 && msg[i] != '\0')
  {
    switch(msg[i])
    {
      case '\t':
        addstr("        ");
        move(line, j+8);
        j+=8;
        break;
      case '\n':
        j = 25;
        break;
      default:
        addch(msg[i]);
        break;
    }
    i++;
    j++;
  }
}

There are the header files:

/* File: datatype.h 
 * Header file containing datatype prototypes - the use of custom
 * datatype simplifies program implementation and improve memory
 * usage.
*/

/* define byte using the smallest C datatype - char */
typedef unsigned char byte;

/* define position using bitfield */
struct position {
  byte x : 4;       /* 4 bits, holds 0 to 15 */
  byte y : 4;
};
typedef struct position position;

/* define game character structure using bitfield */
struct character {
  byte x : 4;
  byte y : 3;       /* 3 bits, holds 0 to 7 */
  byte isalive : 1; /* 1 bit, holds 0 or 1 */
};
typedef struct character character;

/* define cell structure for field array using bitfield */
struct cell {
  byte isvisible : 1;
  byte issafe : 1;
  byte isflaged : 1;
  byte hasmine : 1;
  byte adjmines : 4;
};
typedef struct cell cell;

/* define Glif, used by the show_glif() function to specify the glif image to 
   appear on the board. */
enum Glif {TIMMY, SAFE, EMPTY, FLAG, MINE, FL_MINE, EXPLODE };
typedef enum Glif Glif;
/* File: display.h
* This file contains the interface for the display module for the
 * miensfeld game.  User defined types and function prototypes are
 * specified and explained.
*/
#include <curses.h>

void init_display(void);
/* This function initializes the display.  It must be called at the beginning - 
   before any other function in the display module. */

void reset_display(void);
/* This function terminates the display.  It must be called at the end to put 
   the display back to normal mode. */

void disp_intro(void);
void disp_move(void);
void disp_flag(void);
void disp_point(void);
void disp_menu(void);
void disp_level(void);
/* These functions prints the game intro, the movement keys, the flag keys, the 
   points, the navigation menu, and the level of difficulty, respectively. */

char getkey(void);
/* This function returns the key pressed. */

void draw_board(void);
/* This function draw the game board. */

void update_mines(int num);
void update_flags(int num);
void update_score(int num);
/* These three functions are given an integer in the range 0 to 99 and
   update the display of the mines, flags and score, respectively. */

void show_digit(int dig, int y, int x);
/* This function draws a specified digit at (y,x). */

void put_digit(int y, int x, char *c);
/* This function prints a 3x3 digit with its top left corner at (y,x). */

void show_glif(unsigned char glif, int row, int col, int Adj_count);
/* This function draws a specified Glif on the board at the row and column 
   specified.  The adjecency count, if non-zero, is displayed in the lower 
   right of the glif. */

void put_glif(int y, int x, char *c, int putspace);
/* This function prints a 2x3 glif with its top left corner at (y,x). */

void write_message(int line, char *msg);
/* This function is used to write messages in the left area of the screen. 
   It is given an integer indicating the line of the display (0 to 23) to 
   place the message, given as a string.  It returns nothing.
   The function only displays the first 25 characters of msg, or
   up to the first '\n' in the string.  If no newline is present,
   msg replaces the entire line on the screen.  If a newline is
   present in the string, only characters up to the newline replace
   those on the line, leaving the remainder of the line intact. */
/* File: game_utils.h */
#include <stdlib.h>
#include <stdio.h>

#define MAX_ROW 8
#define MAX_COL 8
#define LIM_ROW 7
#define LIM_COL 7
#define LOWER_LIM 0

#define MOVED 		0
#define WINNER 		1
#define UNMOVED		2
#define MOVED_NEW 	3
#define MOVED_MINE 	4
#define SAFE_UNKNOWN    5
#define SAFE_KNOWN      6

void points(int loc, int *score);
/* Given: Location contents,  a pointer for points */    
/* Returns: New Score */  

int probe(int a[][MAX_COL], int row, int col);
/* Given: Field, and cur location on the field */
/* Returns: Number of mines around cur area */
/* File: menus.h
#define EASY 6
#define MODERATE 11
#define HARD 16
#define IMPOSSIBLE 20

#define PLAY_GAME 4

void print_menu(int n);
/* Given: Choice from menu */
/* Returns: If wants to play */

void clear_screen(void);
/* Clears screen */

int text_intro(void);
/* Given: blank */
/* Returns: If wants to play */

int diffselect(void);
/* Given: blank */
/* Returns: Difficulty */

int retry_game(void);
/* Given: blank */
/* Returns: If want to play */
/* File: mine.h */
int mine_game(int difficulty, int *win);
/* Given: Desired Level */
/* Returns: Plays on that level of difficulty */

#define SAFE 'S'
#define TIMMY 'Y'
#define MINE 'x'
#define EXPLODE '!'
#define FLAG 'P'
#define FL_MINE '*'
/* File: movement.h */
#include "game_utils.h"

int is_flag(char ch);
/* Checks if key entered is valid */

int is_move(char ch);
/* Checks if key entered is valid move key */

int tim_move(char ch, int *row, int *col, int field[][MAX_COL]);
/* Given: A valid movement key,  col/row, cur col/row, and field */
/* Returns: Your move, either into a new spot, and/or win */

int plant_flag(char ch, int *row, int *col, int *prow, int *pcol, int *mines, int field[][MAX_COL]);
/* Given: Move char, cur row/col, the used row/col, and field */
/* Returns: If flag was used on mine or wasn't, and displays the flag on *
 *          field and refreshes field to show that flag has been used    */
/* File: tfdef.h */
/* defines the macros true and false */
#define TRUE  1
#define FALSE 0

AND THIS IS MY MAKEFILE:

# define some macros
CFLAGS = -Aa -g

# finished game
miensfeld: main.o mine.o menus.o movement.o game_utils.o display.o
        cc main.o mine.o menus.o movement.o game_utils.o display.o -o miensfeld -lcurses

# dependancies
main.o: tfdef.h movement.h game_utils.h menus.h mine.h display.h

mine.o: mine.h tfdef.h game_utils.h movement.h mine.h display.h

display.o: datatype.h display.h

displaytest.o: datatype.h display.h

menus.o: menus.h tfdef.h

game_utils.o: game_utils.h

mine.o: game_utils.h tfdef.h movement.h display.h

intro.o: menus.h

movement.o: game_utils.h movement.h tfdef.h mine.h display.h

links:
        ln -s ../display.o .
        ln -s ../display.h .
        ln -s ../move .
        ln -s ../points .
        ln -s ../title1 .
        ln -s ../movements .
        ln -s ../flags .
        ln -s ../glif .
clean:
        mv display.o display.sav
        rm -f *.o
        mv display.sav display.o

real_clean: clean
        rm  -f miensfeld a.out core

Will someone please give me some suggestions?
I'd really appreciate it...

>I just can't seem to compile it.
>Will someone please give me some suggestions?

I'd suggest reading the errors, tracing the source of the problem, and applying a fix to the code. What were you wanting us to do? Debug your code and give you the working program? Do you want fries with that?

theres no way i'm going to copy all that code into files on my local drive and then debug it for you.

start with one error at a time. trace the line that it calls out and fix the problem. then recompile. repeat.

you'll often find a lot of seemingly-unrelated errors will disappear once you fix one thing.

if you're stuck, post the single error and the *relevant* code. not your entire project dump.

we generally suggest fixes for you based on sight. we generally do not compile and trace your code through a debugger. if we can't read your code easily, it's likely to be ignored.

this is not peculiar to this website, it's generally standard behavior in any programming help forum. most people who will help you here are professionals or serious students who have other demands on their time

commented: Kindly put. +8

A simple and kind no would have sufficed. Well, anyways thank you for all your time in reading my post.

actually, i think my response was kinder than a simple "no".

:)

>A simple and kind no would have sufficed.
No, it wouldn't. If it were a simple no, you wouldn't understand why people are refusing to help you. And if it were kind, you wouldn't get enough of a shock to correct your mistake next time.

>A simple and kind no would have sufficed.
No, it wouldn't. If it were a simple no, you wouldn't understand why people are refusing to help you. And if it were kind, you wouldn't get enough of a shock to correct your mistake next time.

rawrrrr. major sass up in here. ^^^^
ALOHA from Hawaii.

hmmm....

burning your bridges? or burned your britches?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.