#include "list.H"

int main()
{
    IntList list;	// Declare an instance of IntList
    int val;		// Temporary integer variable
    int i;		// Temporary integer variable

	// Before testing, we first build a list of integers

	cout << "Building list (1 2 3 4 5 6 7 8 9 10)" << endl << endl;

	for(i=10; i>0; i--)
	list.Cons(i);

	// Now that the list is built, try printing it out.  Note
	// that we can use the << operator to print out instances
	// of our list class since the class overloads it.

	cout << "List elements are:  " << list << endl;


	// Now move into the middle of the list and try

	cout << "First three list elements are: ";
	list.ResetList();
	for(i=1; i<=3; i++)
	{
	    list.GetNextItem(val);
	    cout << val << " ";
	}
	cout << endl;
	cout << "(Fourth list element is now the current position)" << endl;

	list.InsertAfter(50);

	cout << "After inserting 50, list is: " << list << endl;

	return 0;
}

