// file: PlainTester.cpp
// by: Dawn Lawrie
// date: February 17, 2005

#include "PlainFinder.h"

void announce();

int main() {
  
  const int MAP_SIZE = 10;
  PlainFinder pf(MAP_SIZE);
  string fileName;

  announce();

  cout << "Please enter the file name containing data for a " 
       << MAP_SIZE << "x" << MAP_SIZE << " map: ";
  cin >> fileName;

  if (!pf.initMap(fileName)) {
    cerr << "Problem reading data.  Please check " << fileName << "." << endl;
    exit(1);
  }

  Plain win = pf.findLargestPlain();
  cout << endl << "Map: " << endl;
  pf.displayMap();
  
  cout << endl << "Largest plain: " << win.max << endl
       << "Location: (" << win.y+1 << ", " << win.x+1 << ")" << endl;
  return 0;
}

void announce() {
  cout << endl
       <<"This program finds the largest plain in a map using the" << endl
       << "data in the file you will enter."  << endl << endl;
}
