/* Translation tables for Program 3.
   Letter to Morse: letterTable
   Number to Morse: numberTable
   Punctuation to Morse: punctTable
   Index array for punctTable: punctMarks

   G. Byrd
   Fall 2010
*/


char * letterTable[26] = 
  { ".-",      /* A */
    "-...",    /* B */
    "-.-.",    /* C */
    "-..",     /* D */
    ".",       /* E */
    "..-.",    /* F */
    "--.",     /* G */
    "....",    /* H */
    "..",      /* I */
    ".---",    /* J */
    "-.-",     /* K */
    ".-..",    /* L */
    "--",      /* M */
    "-.",      /* N */
    "---",     /* O */
    ".--.",    /* P */
    "--.-",    /* Q */
    ".-.",     /* R */
    "...",     /* S */
    "-",       /* T */
    "..-",     /* U */
    "...-",    /* V */
    ".--",     /* W */
    "-..-",    /* X */
    "-.--",    /* Y */
    "--.."     /* Z */
  };

char * numberTable[10] = 
  { "-----",   /* 0 */
    ".----",   /* 1 */
    "..---",   /* 2 */
    "...--",   /* 3 */
    "....-",   /* 4 */
    ".....",   /* 5 */
    "-....",   /* 6 */
    "--...",   /* 7 */
    "---..",   /* 8 */
    "----."    /* 9 */
  };

/* NOTE: Some punctuation marks need to be "escaped"
   with a backslash character, because the character
   would otherwise be interpreted differently:
   e.g, " is \", so that it doesn't end the string.
   (p. 65, CPP)
*/
char punctMarks[19] = ".\?\'!/()&:;=+-_\"$@,";

char * punctTable[18] =
  { ".-.-.-",  /* . */
    "..--..",   /* ? */
    ".----.",  /* ' */
    "-.-.--",  /* ! */
    "-..-.",   /* / */
    "-.--.",   /* ( */
    "-.--.-",  /* ) */
    ".-...",   /* & */
    "---...",  /* : */
    "-.-.-.",  /* ; */
    "-...-",   /* = */
    ".-.-.",   /* + */
    "-....-",  /* - */
    "..--.-",  /* _ */
    ".-..-.",  /* " */
    "...-..-", /* $ */
    ".--.-.",  /* @ */
    "--..--"   /* , */
  };

