Running out of memory when using many if statements

UKHeliBob:

  if (letter_to_get == 'a')

{
   this->copy_letter(letter_a);
 }




As you have noted there are numerous sections of code like this. It seems to me that you could use the ASCII value of letter_to_get as an index into an array of characters to remove the need for multiple tests.

I guess this won't be memory friendly as the job of that function is to make copy_letter function copy the corresponding letter which is an array into another array

char letter_a[8][8]={{0,0,0,0,0,0,0,0},
                     {0,0,1,1,1,1,0,0},
                     {0,1,0,0,0,0,1,0},
                     {0,1,0,0,0,0,1,0},
                     {0,1,0,0,0,0,1,0},
                     {0,1,1,1,1,1,1,0},
                     {0,1,0,0,0,0,1,0},
                     {0,1,0,0,0,0,1,0} };