text: #include "main.h"
  
  
  int main(int argc, char *argv[]) {
    
    int l1 = 0, l2 = 0, done = 0, invalid = 0;
    int g = 0, c = 0, t = 0, p = 0, ct = 0, cp = 0, i = 0, o = 0;
  
    for (int j = 1 ; j < argc; j++){
  
      if (!(strcmp(argv[j],"-g"))){
        g = 1;
      }
      if (!(strcmp(argv[j],"-c"))){
        c = 1;
      }
      if (!(strcmp(argv[j],"-t"))){
        t = 1;
      }
      if (!(strcmp(argv[j],"-p"))){
        p = 1;
      }
      if (!(strcmp(argv[j],"-ct"))){
        ct = 1;
      }
      if (!(strcmp(argv[j],"-cp"))){
        cp = 1;
      }
      if (!(strcmp(argv[j],"-i"))){
        i = j+1 ;
      }
      if (!(strcmp(argv[j],"-o"))){
        o = j+1;
      }
    }
  
    
  
    if (g){
      printf("Enter the length of the two sequences: ");
      scanf("%d %d", &l1, &l2);
      if(o){
         generateDoubleRandom(l1, l2, 1, argv[o]);
         printf("Sequences in file %s\n", argv[o]);
      }
      else{
         generateDoubleRandom(l1, l2, 0, argv[o]);
      }
      done = 1;
    }
  
    else if (i){
      getSequences(argv[i],s1,s2,l1,l2);
      done = 1;
    }
    else if (ct||cp||c){
      inputValidation(s1, s2, l1, l2);
      done = 1;
    }
    else {
      singleInput(s1, l1);
      done = 1;
    }
  
    if (c){
      if (len1 == -1 || len2 == -1){
        goto invalidSequence;
      }
      if (o){
        LCS(s1,s2,len1,len2,91,argv[o]);
      }
      else{
        LCS(s1, s2, len1, len2, 0, argv[o]);
      } 
      done = 1;
    }
    if (t){
      if (len3 == -1){
        invalid = 1;
        goto invalidSequence;
      }
       if (o){
        LTS(s1,len3,89,argv[o]);
       }
       else{
        LTS(s1,len3,0,argv[o]);
       }
       done = 1;
    }
    if (p){
      if (len3 == -1){
        invalid = 1;
        goto invalidSequence;
      }
      if (o){
        LPS(s1, len3, 89, argv[o]);
      }
      else{
        LPS(s1, len3, 0, argv[o]);
      }
      done = 1;
    }
  
    if (ct){
      if (len1 == -1 || len2 == -1){
        invalid = 1;
        goto invalidSequence;
      }
      if (o){
        LCTS(s1, s2, len1, len2, 89,argv[o]);
      }
      else{
        LCTS(s1, s2, len1, len2, 0,argv[o]);
      }
      done = 1;
    }
    if (cp){
      if (len1 == -1 || len2 == -1){
        invalid = 1;
        goto invalidSequence;
      }
      if (o){
        LCPS(s1, s2, len1, len2, 89, argv[o]);
      }
      else{
        LCPS(s1, s2, len1, len2, 0, argv[o]);
      }
      done = 1;
  
    }
    if (done == 0){
      printf("-g: to generate an instance consisting of two sequences over the digit alphabet");
      printf("-c: to compute an LCS for the two input sequences");
      printf("-t: to compute an LTS for the input sequence");
      printf("-p: to compute an LPS for the input sequence");
      printf("-ct: to compute an LCTS for the two input sequences");
      printf("-cp: to compute an LCPS for the two input sequences");
      printf("-i inputfilename: to read in sequence(s) from file inputfilename");
      printf("-o outputfilename: to write all the results into the file outputfilename");
    }
    invalidSequence:
    if (invalid){
    printf("Invalid Sequence Entered, Please enter a correct sequence");
    return 0;}
    return 0;
  }
  