// This is the CPP file you will edit and turn in.
// Also remove these comments here and add your own.
// TODO: remove this comment header

#include <cctype>
#include <cmath>
#include <fstream>
#include <iostream>
#include <string>
#include "console.h"
#include "testing/SimpleTest.h"
#include "filelib.h"
#include "lexicon.h"
#include "simpio.h"
#include "strlib.h"
#include "stack.h"
#include "queue.h"

using namespace std;

// function prototypes (you should add more here)
Lexicon loadLexicon();
Stack<string> createWordLadder(string wordOne, string wordTwo, Lexicon &dictionary);

int main() {
    if (runSimpleTests(SELECTED_TESTS)) {
        return 0;
    }
    // TODO: Finish the program!


    cout << "Have a nice day." << endl;
    return 0;
}

/*
 * This function prompts the user for a filename, and then
 * loads that file into a Lexicon, which is returned
 */
Lexicon loadLexicon() {
    // TODO: write the code for this function

    return Lexicon(); // change this line
}

/*
 * This function creates the word ladder from two words and a dictionary.
 * It returns a Stack of strings where the top of the stack is the second word, the bottom of
 * the stack is the first word, and the strings that form the word ladder between them.
 */
Stack<string> createWordLadder(string wordOne, string wordTwo, Lexicon &dictionary) {
    // TODO: Write this function

    // return the correct stack
    return {};
}

PROVIDED_TEST("Testing smalldict1.txt with dig to hug") {
    Lexicon lex = Lexicon("res/smalldict1.txt");
    Stack<string> wordLadder = createWordLadder("dig", "hug", lex);
    Stack<string> digHug = {"dig", "dog", "bog", "bug", "hug"}; // top of stack on right
    EXPECT_EQUAL(digHug, wordLadder);
}
