/*
 * File: gondor.cpp
 * -------------
 * This program simulates the lighting of the fires in The Lord of the Rings.
 */

#include <iostream>
#include <string>
#include <assert.h>
#include <cmath>
#include "console.h"
#include "error.h"
#include "simpio.h"
#include "map.h"
#include "gwindow.h"
#include "timer.h"
#include "grid.h"
#include "strlib.h"
using namespace std;

struct Tower {
    string name;
    Tower * link;
};

Tower *createTower(string name, Tower *link) {
   Tower *temp = new Tower;
   temp->name = name;
   temp->link = link;
   return temp;
}

void signal(Tower *start) {
   if (start != nullptr) {
      cout << "Lighting " << start->name << endl;
      signal(start->link);
   }
}

int main() {
    Tower * head;

    head = createTower("Rohan", nullptr);
    // NOW HEAD HAS A NEW VALUE!!!!!
    head = createTower("Halifirien", head);
    head = createTower("Calenhad", head);
    head = createTower("Min-Rimmon", head);
    head = createTower("Erelas", head);
    head = createTower("Nardol", head);
    head = createTower("Eilenach", head);
    head = createTower("Amon Din", head);
    head = createTower("Minas Tirith", head);

    signal(head);

    return 0;
}
