//Sean Palmer C++ Programming II Final Project, see game.C for full description #include #include //for the srand function and EXIT_SUCCESS #include //for the time function #include //for set_new_handler, bad_alloc #include "game.h" using namespace std; void custom_handler(); int main() { srand(static_cast(time(0))); set_new_handler(custom_handler); cout << "\nWELCOME TO P-MAN 2.0\nby Sean Palmer\n\nv2.0.5" << "\nc2008 All Rights Reserved." << "\n\nSelect a Level of Difficulty\n[1 (easiest) to 5 (hardest)] : "; unsigned short difficulty; if (cin >> difficulty && difficulty <=5 && difficulty >=1) { game(difficulty).play(); cout << "\nGOOD BYE!\n\n"; return EXIT_SUCCESS; } else { cerr << "\nINVALID CHOICE, should be a number 1-5, inclusive\n"; exit(EXIT_FAILURE); } } void custom_handler() { cerr << "whoops! out of store!\n"; exit(EXIT_FAILURE); }