Metropoli BBS
VIEWER: findlmts.c MODE: TEXT (ASCII)
/* ***********************************************************************
   *									 *
   *	        Program to Find Highest and Lowest z-Values		 *
   *									 *
   *				Program by				 *
   *			   Christopher D. Watkins			 *
   *									 *
   *			     'C' conversion by				 *
   *                            Larry Sharp				 *
   *									 *
   ***********************************************************************

*/

#include "stdio.h"
#include "dos.h"
#include "conio.h"
#include "math.h"
#include "string.h"
#include "math.inc"
#include "graph.inc"
#include "render.inc"

int i, j;
int a, b, c;
int x1, y1;
int x2, y2;

void main()
{
  clrscr();
  printf("Find Locations of Highest and Lowest Points\n");
  ClearHeightBuffer();
  GetObjectFile();
  LoadHeightBuffer(ObjectFile);
  b=0;
  c=32767;
  for(i=0; i<=Res; i++)
  {
    for(j=0; j<=Res; j++)
    {
      a=Height[i][j];
      if(a>b)
      {
	x1=i;
	y1=j;
	b=a;
      }
      if(a<c)
      {
	x2=i;
	y2=j;
	c=a;
      }
    }
  }
  printf("\nHigh Point is (%d, %d) = %d\n", x1, y1, b);
  printf("Low Point is (%d, %d) = %d\n\n\n", x2, y2, c);
  puts("Hit any key to exit.");
  getch();
}
[ RETURN TO DIRECTORY ]