forked from aaronbloomfield/pdr
-
Notifications
You must be signed in to change notification settings - Fork 228
/
traveling-skeleton.cpp
49 lines (40 loc) · 1.56 KB
/
traveling-skeleton.cpp
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
39
40
41
42
43
44
45
46
47
48
49
#include <iostream>
#include <cstdlib>
#include <algorithm>
using namespace std;
#include "middleearth.h"
float computeDistance(MiddleEarth me, const string& start, vector<string> dests);
void printRoute(const string& start, const vector<string>& dests);
int main(int argc, char** argv) {
// check the number of parameters
if (argc != 6) {
cout << "Usage: " << argv[0] << " <world_height> <world_width> "
<< "<num_cities> <random_seed> <cities_to_visit>" << endl;
exit(0);
}
// we'll assume the parameters are all well-formed
int width = stoi(argv[1]);
int height = stoi(argv[2]);
int num_cities = stoi(argv[3]);
int rand_seed = stoi(argv[4]);
int cities_to_visit = stoi(argv[5]);
// create the world, and select your itinerary
MiddleEarth me(width, height, num_cities, rand_seed);
vector<string> dests = me.getItinerary(cities_to_visit);
// TODO: YOUR CODE HERE
return 0;
}
// This method will compute the full distance of the cycle that starts
// at the 'start' parameter, goes to each of the cities in the dests
// vector IN ORDER, and ends back at the 'start' parameter.
float computeDistance(MiddleEarth me, const string& start, vector<string> dests) {
// TODO: YOUR CODE HERE
return 0;
}
// This method will print the entire route, starting and ending at the
// 'start' parameter.
// The output should be similar to:
// Erebor -> Khazad-dum -> Michel Delving -> Bree -> Cirith Ungol -> Erebor
void printRoute(const string& start, const vector<string>& dests) {
// TODO: YOUR CODE HERE
}