/////////////////////////////////////////////////////////////////////// // Context.cpp - Strategy Example Code - Sorting // // Ver: 1.1 // // Language: Visual C++ 2010 // // Platform: Dell Dimension T7400, Win 7, Pro // // Author: Jim Fawcett, CSE776 - Design Patterns, Fall 2011 // // Source: Lei Zhang, lzhang17@syr.edu // // from internet - no longer have url // /////////////////////////////////////////////////////////////////////// #include "Context.h" #include using namespace std; void Context::recordGenerator(size_t count) { num.clear(); for(int i = count; i > 0; --i) num.push_back(rand() % count + 1); // return value of hand //num.push_back(i); } void Context::display() { size_t k = 50; if(num.size() < k) k = num.size(); cout << "\n"; for(size_t i = 0; i < k; ++i) { cout << " " << setw(7) << num[i]; if((i+1) % 10 == 0) cout<