/* * craps.cpp * * Created on: Sep 25, 2010 * Modified November 7, 2016 * Author: Michael J. Fischer * for use in Yale course CPSC 427a, Fall 2010 */ #include "params.hpp" #include "sim.hpp" #include "tools.hpp" // Static function prototype static void run( int argc, char* argv[] ); //----------------------------------------------------------------------------- int main(int argc, char* argv[]) { banner(); try { run( argc, argv ); } catch (Fatal& e) { cerr << "Catching Fatal exception\n" << e.what() << endl; } catch (...) { std::cerr << "Uncaught exception" << std::endl; } bye(); } //----------------------------------------------------------------------------- void run ( int argc, char* argv[] ) { // Get parameters Params p(argc, argv); cout << p << endl; // Create and print simulator Simulator sim(p); cout << sim << endl; // Run experiment sim.experiment(); // Print results sim.printResults(cout); }