summaryrefslogtreecommitdiff
path: root/main.cpp
blob: c40b00725a9c52b9f3d5f2225b8515f2b8e0f278 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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;
}