fables.cpp

// Programmer: Clayton Price date: 11/1/13

// File: fables.cpp cs 53

// Purpose: this fie contains the main function to change a fable read in

// from a file and then output it to another file.

#include "fables.h"

using namespace std;

int main()

{

ifstream fin,win; //fable stream and word stream

char response;

char title_noun1[MAX_WORD_SIZE],title_noun2[MAX_WORD_SIZE];

char replace1[MAX_WORD_SIZE],replace2[MAX_WORD_SIZE]; //for replacements of

// title nouns

string fable_file; //holds name of file for a fable

short len_list1 = file_length("list1.txt"); //get lengths of list files

short len_list2 = file_length("list2.txt");

short len_rantfile = file_length("moerants.txt");

short len_MOErals = file_length("MOErals.txt");

srand(time(NULL));

do //loop on fables

{

do //get repeat response

{

cout<<"\n\n\nSo, "<<USER<<", are you wannt'n a fable?(y/n) ";

cin>>response;

} while (response != 'n' && response != 'y');

if (response == 'y')

{

fable_file = get_random_fable_file();

get_random_word(replace1,"list1.txt",len_list1); //get random words to

get_random_word(replace2,"list2.txt",len_list2); // replace title nouns

get_title_nouns(title_noun1,title_noun2,fable_file);

process_fable(title_noun1,title_noun2,replace1,replace2,fable_file,

len_list2,len_rantfile,len_MOErals);

}

} while (response == 'y');

cout<<"\n\nEXITING.............."<<endl<<endl;

return 0;

}