forked from aaronbloomfield/pdr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtraveling-skeleton.cpp
46 lines (40 loc) · 1.6 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
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
#include "middleearth.h"
float computeDistance (MiddleEarth &me, string start, vector<string> dests);
void printRoute (string start, 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, height, num_cities, rand_seed, cities_to_visit;
sscanf (argv[1], "%d", &width);
sscanf (argv[2], "%d", &height);
sscanf (argv[3], "%d", &num_cities);
sscanf (argv[4], "%d", &rand_seed);
sscanf (argv[5], "%d", &cities_to_visit);
// Create the world, and select your itinerary
MiddleEarth me(width, height, num_cities, rand_seed);
vector<string> dests = me.getItinerary(cities_to_visit);
// 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, string start, vector<string> dests) {
// YOUR CODE HERE
}
// This method will print the entire route, starting and ending at the
// 'start' parameter. The output should be of the form:
// Erebor -> Khazad-dum -> Michel Delving -> Bree -> Cirith Ungol -> Erebor
void printRoute (string start, vector<string> dests) {
// YOUR CODE HERE
}