/*
Programmer: Jennifer Leopold
Date: March 14, 2016
File: hw8.cpp
Purpose: This program generates poetry, randomly selecting
nouns, verbs, adjectives, interjections, pronouns,
and adverbs from data files containing possible
such words. Each line of a poem is constructed
according to a pattern randomly selected from a
file that specifies the order of each part of speech.
User input determines how many lines are in the
poem.
To compile: g++ hw8.cpp hw8fncts.cpp -o hw8
To execute: ./hw8
*/
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <string.h>
#include "hw8_functs.h"
using namespace std;
int main()
{
int numLinesInPoem; // user response to "# lines in poem?"
// Seed the random number generator
srand(time(NULL));
cout << "\nWelcome to Cletus' Poetry Corner!\n\n";
// Generate poems as long as user wants to
do
{
numLinesInPoem =
getIntInput("\nHow many lines do you want in your poem? ",
MIN_LINES, MAX_LINES);
if (numLinesInPoem > 0)
generatePoem(numLinesInPoem);
} while (numLinesInPoem > 0);
cout << "\nFare 'yins well!\n";
return 0;
}