#include #include //for the srand function and EXIT_SUCCESS #include //for the time function #include //for bad_alloc #include //for exception #include "game.h" using namespace std; int main(int argc, char **argv) { int status = EXIT_FAILURE; //guilty until proven innocent srand(static_cast(time(0))); try { game g; g.play(); status = EXIT_SUCCESS; } catch (const bad_alloc& bad) { cerr << argv[0] << ": new failed: " << bad.what() << "\n"; } catch (const exception& e) { cerr << argv[0] << ": " << e.what() << "\n"; } catch (...) { cerr << argv[0] << ": main caught unexpected exception.\n"; } return status; }