#include <stdlib.h>
#include <stdio.h>

void main(int argc, char *argv[]) {
  int i=0;
  int eq_count=0;
  int fail=0;
  char buffer[400]={0};
  if(argc!=2) {
    printf("Incorrect number of arguments! argc=%d\n",argc);
    exit(0);
  }
  if(strlen(argv[1])>399) {
    printf("Input string too long! %d characters, 400 max\n",strlen(argv[1]));
    exit(0);
  }
  strcpy(buffer,argv[1]); 
  //parse for crap:  should have 12 = signs, and 
  //no bizzar characters
  for(i=0;buffer[i]!='\0';i++)  {
     switch(buffer[i]) {
	case 'h': case 'e': case 'i':  case 'g':  case 't':
	case 'w': case 'd': case '&':  case 'q':  case 'c': case 'S':
	case 'I': case 'N': case 'C':  case 'O':  case '-': case '*':
	case '%': case 'B': case 'F':  case '1':  case '2': case '3':
	case '4': case '5': case '6':  case '7':  case '8': case '9':
	case '0': break;

	case '=': eq_count++;
	break;
	default:
	  fail=1;
     }
  }
  if(eq_count!=12) fail=1;
  if(fail) {
    printf("Dead Meat! argc=%d\n",argc);
    printf("May be bad input letter\n");
    printf("Equal Count Should be 12.  eq_count=%d\n",eq_count);
  } else {
    printf("Fresh Meat! argc=%d\n",argc);
  }


  i=0;
  while(buffer[i]!='=') i++;
  i++;
  //height

  while(buffer[i]!='=') i++;
  i++;
  //width

  while(buffer[i]!='=') i++;
  i++;
  //color1

  while(buffer[i]!='=') i++;
  i++;
  //eq1


}
