#include <iostream>

using namespace std;

#include "deque.hpp"

int main()
{

    deque<int> a;
    
    cout << "pushing 0 to 9\n";
    for (int i=0;i<10;i++)
        a.push_front(i);

    cout << "show first and last\n";
    cout << a.front() << endl;
    cout << a.top() << endl;
    
    cout << "pop last\n";
    a.pop_back();
    cout << a.front() << endl;
    cout << a.top() << endl;
    
    cout << "pop first\n";
    a.pop_front();
    cout << a.front() << endl;
    cout << a.top() << endl;
    
    cout << "push back 20 to 11\n";
    for (int i=20;i>10;i--)
        a.push_back(i);

    cout << "show first and last\n";
    cout << a.front() << endl;
    cout << a.top() << endl;
    
    cout << "pop last\n";
    a.pop_back();
    cout << a.front() << endl;
    cout << a.top() << endl;
    
    cout << "pop first\n";
    a.pop_front();
    cout << a.front() << endl;
    cout << a.top() << endl;

    cout << "size = " << a.size() << endl;

    cout << "make a copy\n";
    deque<int> b(a);
    cout << "size of the copy = " << b.size() << endl;
    for (int i=0;i<16;i++)
        cout << "pop_front " << b.pop_front() << endl;

    cout << "make another copy by assignation\n";
    deque<int> c = a;
    cout << "size of the copy = " << c.size() << endl;
    for (int i=0;i<16;i++)
        cout << "pop_back " << c.pop_back() << endl;

    return 0;
}
