#include<iostream>
#include<fstream>
#include<string>
#include"DoubleStack.h" //remember to define all function in header
						//as mentioned in the class News (Aug 24)

using namespace std;

int main(){
	DoubleStack<string> q;
	q.pushRed("Russia"); q.pushRed("Stop"); q.pushRed("Blood");
	q.pushBlue("Moon"); q.pushBlue("Blood"); q.pushBlue("Sky");

	cout << q << endl;	//you must implement operator<< for DoubleStack.
						//It should print:
						//Red: Russia Stop Blood
						//Blue: Moon Blood Sky

	for (int count =0; count <1; count++){ //to test if your destructor works OK
		DoubleStack<string> p(10);

	//I will now read some words from this file and push them
	//into the stack.
		ifstream ifs("//Engr_asu/ECE352/words");
		string s;
		int i;
		for (i=0;i <10000; ++i){
			ifs >> s;
			p.pushRed(s);
		};
		for (i=0;i<20000;++i){
			ifs >> s;
			p.pushBlue(s);
		};
	//Pop and print some of the words.
		cout << "Blue: ";
		for (i=0; i< 10; ++i){
			string w = p.topBlue();
			cout << w << " ";
			p.popBlue();
		}
		cout << endl << "Red: ";
		for (i=0; i< 10; ++i){
			string w = p.topRed();
			cout << w << " ";
			p.popRed();
		}
		cout << endl;
	}
	return 0;
}