SOURCE FILE: lettersLev02Shell.cpp



/* 

This file contains suggested code for your level-two program.
However, I *don't* recommend that you use the *comments* here in
your program. Make up your own comments.  (Basically you need to
change things all around so that each function has a nice header
comment.  Most of the in-line comments here should be deleted
from the finished product.)

*/

/* -------------------- */

/* typical include files for when we need to work with file
   streams and strings. */

#include <fstream.h> //includes iostream.h
#include <string>

/* -------------------- */

/* Declare "magic numbers" as constants. " */

const int numRows = 24 ;
const int numCols = 75 ;
const int numChars = 26 ;

/* -------------------- */

/* Declare blockLetterType == data type to store one block letter
   and declare alphabetType == data type to store a set of 26 block letters.
*/

typedef char blockLetterType[numRows][numCols] ;
typedef blockLetterType alphabetType[numChars]  ;

/* -------------------- */

/* #################### */
/*    loadOneLetter     */
/* #################### */

      /* NOTE THIS: letter is passed by reference "automatically" */

void loadOneLetter (string filename, blockLetterType letter)
{
    /* Put your stub code here */
}

/* #################### */
/*    writeOneLetter    */
/* #################### */
void writeOneLetter (blockLetterType letter)
{ 
    /* Put your stub code here */
}

/* #################### */
/*   loadLetterFiles    */
/* #################### */

      /* NOTE THIS: alphabet is passed by reference "automatically" */

void loadLetterFiles (alphabetType alphabet) 
{ 
  string filename ;

/* 

          Simplest thing to do here: you can just repeat a bunch
	  of sequences like those below to get all the letters
	  you need loaded up.  We assume that loadOneLetter() can
	  put the contents of the designated file into the
	  designated block letter grid.
*/

  filename = "Alpha/M" ;
  loadOneLetter(filename, alphabet[12]) ;

/* 

       If you have energy and time left over you could try to
       figure out how to write a loop with just a few lines that
       loads all 26 letters.  (*Not* necessary, though --
       "simplest way" described above gets the job done.)

*/

} 

/* #################### */
/*      printPhrase     */
/* #################### */
void printPhrase (alphabetType alphabet) 
{ 

/* 

       Simplest thing to do here: make enough calls like the one
       below, and your phrase will be written out.  We assume
       that writeOneLetter() will copy all the characters out of
       the designated block letter grid for us in the correct
       manner to put the block letter on the screen.

*/

  writeOneLetter (alphabet[12]) ;

/* 

       If you have energy and time left over you could try to
       figure out how to use a string variable and a loop to give
       this function the power to input an arbitrary string and
       write it out in block letters.  (*Not* necessary, though
       -- "simplest way" described above gets the job done.)


*/



}

/* #################### */
/*         MAIN         */
/* #################### */
/* 

      main program Letter -- add whatever else you need here.

*/

main()
{ 

/* 

     This gives you storage for 26 block letters 

*/
  alphabetType  alphabet ;  


/* 

    You pass alphabet (as a parameter) to function
    loadLetterFiles and loadLetterFiles loads all the letters
    needed from the appropriate files into the appropriate array
    slots of alphabet.

*/
  loadLetterFiles (alphabet) ;

  do
  {

/* 

        ...  fill in what you need to make this work.  This loop
	could call
        
              printPhrase(alphabet) 

        Function printPhrase writes your phrase to the screen by
	copying block letters out of the appropriate slots in
	alphabet in the appropriate order.

*/

  } while  (/* what goes here? */) ;

} /* main program Letter */