/*----
  signature: main: void -> int
  purpose: testing program for the function guess_match

  by: Sharon Tuttle
  last modified: 2022-09-01
----*/

#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include "guess_match.h"
using namespace std;

int main()
{
    cout << boolalpha;

    cout << "*** testing guess_match ***" << endl;

    cout << (guess_match("great", "brake")
             == "gray green gold gray gold ")
         << endl;
    cout << (guess_match("stomp", "bugle")
             == "gray gray gray gray gray ")
         << endl;

    cout << "Enter a guess: ";
    string a_guess;
    cin >> a_guess;

    const string WORD_OF_DAY = "thank";

    string latest_match =
        guess_match(WORD_OF_DAY, a_guess);

    while (latest_match !=
            "green green green green green ")
    {
        cout << "Not quite - here is how close "
             << "you were: " << endl;
        cout << latest_match << endl;

        cout << "Enter a guess: ";
        cin >> a_guess;
        latest_match =
            guess_match(WORD_OF_DAY, a_guess);
    }

    cout << "YES! YOU GOT IT!" << endl;

    return EXIT_SUCCESS;
}