diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..c40b007 --- /dev/null +++ b/main.cpp @@ -0,0 +1,38 @@ +#include <iostream> +#include <string> +#include <stdlib.h> +#include "city.h" + +int main() { + const unsigned int ROBBER_WIN_VAL = 438; + const unsigned int MAX_TURNS = 30; + const unsigned int RAND_SEED = 85; + city::CITY_STATUS status = city::CITY_STATUS::CONTINUE; + city engine(ROBBER_WIN_VAL, MAX_TURNS); + + srand(RAND_SEED); + + while(status == city::CITY_STATUS::CONTINUE) { + status = engine.runTurn(); + engine.printMap(); + } + switch(status) { + case city::CITY_STATUS::COPS_WIN: + std::cout << "Cops win the case due to all robbers being arrested." << std::endl; + break; + case city::CITY_STATUS::ROBBERS_MAX_VAL: + std::cout << "Robbers win due to collectively obtaining more then $" << ROBBER_WIN_VAL << std::endl; + break; + case city::CITY_STATUS::ROUNDS_DEPLETED: + std::cout << "Robbers win because the maximum number of turns (" << MAX_TURNS << ") have been reached." << std::endl; + break; + case city::CITY_STATUS::CONTINUE: //prevent compiler warning + break; + } + + std::cout << "Summary of chase: \n" << std::endl; + engine.summarize(); + + return 0; +} + |