#include <stdio.h>
#include <string.h>

#include "mygraph.h"
#include "mydebug.h"
#include "point.h"
#include "line.h"

int DEBUG;

main (int argc, char * argv[]) {

    point apoint;
    line  aline;
    float slope;
    int   i;

    DEBUG = NO_DEBUG; 

    for (i=1;i<argc;){
      
	 if (strcmp (argv[i],"-Dline") ==0 ) {
	     DEBUG |= LINE_LEVEL;
	     i++;
	 } else if (strcmp (argv[i],"-Dpoint") ==0 ) {
             DEBUG |= POINT_LEVEL;
	     i++;
         } else if (strcmp (argv[i],"-Dlow") ==0 ) {
	     DEBUG |= MIN_DEBUG;
	     i++;
         } else if (strcmp (argv[i],"-Dmedium") ==0 ) {
             DEBUG |= MED_DEBUG;
             i++;
       	 } else if (strcmp (argv[i],"-Dhigh") ==0 ) {
             DEBUG |= HIGH_DEBUG;
             i++;
       	 }
    }
   
  
   printf ("Debug level %d\n",DEBUG);
    read_point(&apoint);

    print_point (apoint);
    printf ("\n");

    read_line(&aline);

    print_line (aline);

    if (0 == calculate_slope(aline,&slope)) { 
       printf ("That line has a slope of %f\n", slope);
    } else {
       printf ("That line has a slope of infinity\n");
    }

}
