Commit 7c040dd6 authored by Elon Bontemps's avatar Elon Bontemps
Browse files

autosave

parents cd0cc8c1 37773ebd
......@@ -7,14 +7,17 @@
using namespace std;
//function returns map of pairs
map<string, pair<double, double>> mapMaker() {
pair<double, double> longAndLat () {
ifstream fin;
fin.open("countries.txt");
//cout << "What city/country are you from/closest to: "
ifstream filestream("countries.txt");
print("Print this", filestream);
//variables
map<string, pair<double, double>> tempMap;
pair<double,double> tempPair;
vector <pair<double, double>> coordinateVector;
map<string, pair<double, double>> tempMap();
string placeName;
int cityNum;
if(!fin.is_open()) {
cerr << "Error couldn't open file." << endl;
......@@ -22,13 +25,37 @@ map<string, pair<double, double>> mapMaker() {
}
while(!fin.eof()) {
pair<double,double> tempPair;
getline(fin, placeName, '.');
getline(fin, tempPair.first, '.');
getline(fin, tempPair.second, '\n');
coordinateVector.push_back(tempPair); //ads latitudes and longitutes to coordinate vector
tempMap.emplace(placeName, tempPair);
placeName.clear();
}
//<<<<<<< HEAD
return tempMap;
}
//=======
//output the country.txt file onto the system
//give eric the specific line the user chooses in the text file and give just coordimnates
// TODO Print the cities
do {
cout << "Which city do you live in/live near?: ";
if (!(cin >> cityNum)) { // validates that numbers were entered and checks input
cerr << "Error! Please enter a valid integar." << endl;
cin.clear();
cin.ignore(1000, '\n');
continue;
}
if (cityNum > 0 && cityNum < 40) {
break;
} else {
cerr << "Error! Invalid year. Please enter a year between 1 and 9099" << endl;
}
} while (true);
return coordinateVector.at(cityNum - 1);
}
//>>>>>>> 37773ebd81c48909890df464721d8b1870634f96
......@@ -438,7 +438,6 @@ vector <pair<double, double>> viewFinder (pair <double, double> centerPt) { // f
return corners;
}
<<<<<<< HEAD
vector <pair<double, double>> constellationCoordinates () {
vector <pair<double, double>> coordinates;
// Canis Major
......@@ -541,19 +540,145 @@ vector <pair<double, double>> constellationCoordinates () {
// Leo
pair<double, double> pair8a;
pair8a = make_pair();
pair8a = make_pair(12.1, 32.0);
coordinates.push_back(pair8a);
pair<double, double> pair8b;
pair8b = make_pair(6.1, -9.0);
pair8b = make_pair(9.5, 32.0);
coordinates.push_back(pair8b);
pair<double, double> pair8c;
pair8c = make_pair(7.45, -33.0);
pair8c = make_pair(12.1, 7.0);
coordinates.push_back(pair8c);
pair<double, double> pair8d;
pair8d = make_pair(6.1, -33.0);
pair8d = make_pair(9.5, 7.0);
coordinates.push_back(pair8d);
// Virgo
pair<double, double> pair9a;
pair9a = make_pair(15.0, 9.0);
coordinates.push_back(pair9a);
pair<double, double> pair9b;
pair9b = make_pair(12.0, 9.0);
coordinates.push_back(pair9b);
pair<double, double> pair9c;
pair9c = make_pair(15.0, -12.0);
coordinates.push_back(pair9c);
pair<double, double> pair9d;
pair9d = make_pair(12.0, -12.0);
coordinates.push_back(pair9d);
// Aquila
pair<double, double> pair10a;
pair10a = make_pair(20.3, 13.0);
coordinates.push_back(pair10a);
pair<double, double> pair10b;
pair10b = make_pair(19.0, 13.0);
coordinates.push_back(pair10b);
pair<double, double> pair10c;
pair10c = make_pair(20.3, -5.0);
coordinates.push_back(pair10c);
pair<double, double> pair10d;
pair10d = make_pair(19.0, 13.0);
coordinates.push_back(pair10d);
// Sagitarius
pair<double, double> pair11a;
pair11a = make_pair(20.0, -20.0);
coordinates.push_back(pair11a);
pair<double, double> pair11b;
pair11b = make_pair(18.0, -20.0);
coordinates.push_back(pair11b);
pair<double, double> pair11c;
pair11c = make_pair(20.0, -44.4);
coordinates.push_back(pair11c);
pair<double, double> pair11d;
pair11d = make_pair(18.0, -44.4);
coordinates.push_back(pair11d);
// Scorpius
pair<double, double> pair12a;
pair12a = make_pair(18.0, -21.1);
coordinates.push_back(pair12a);
pair<double, double> pair12b;
pair12b = make_pair(16.0, -21.0);
coordinates.push_back(pair12b);
pair<double, double> pair12c;
pair12c = make_pair(18.0, -42.0);
coordinates.push_back(pair12c);
pair<double, double> pair1d;
pair12d = make_pair(16.0, -42.0);
coordinates.push_back(pair12d);
// Capricornus
pair<double, double> pair13a;
pair13a = make_pair(21.8, -12.0);
coordinates.push_back(pair13a);
pair<double, double> pair13b;
pair13b = make_pair(20.3, -12.0);
coordinates.push_back(pair13b);
pair<double, double> pair1c;
pair13c = make_pair(21.8, -28.0);
coordinates.push_back(pair13c);
pair<double, double> pair13d;
pair13d = make_pair(20.3, -28.0);
coordinates.push_back(pair13d);
// Pegasus
pair<double, double> pair14a;
pair14a = make_pair(.2, 30.0);
coordinates.push_back(pair14a);
pair<double, double> pair14b;
pair14b = make_pair(21.2, 30.0);
coordinates.push_back(pair14b);
pair<double, double> pair1c;
pair14c = make_pair(.2, 6.0);
coordinates.push_back(pair14c);
pair<double, double> pair14d;
pair14d = make_pair(21.2, 6.0);
coordinates.push_back(pair14d);
// Pisces
pair<double, double> pair15a;
pair15a = make_pair(2.0, 31.0);
coordinates.push_back(pair15a);
pair<double, double> pair15b;
pair15b = make_pair(23.1, 31.0);
coordinates.push_back(pair15b);
pair<double, double> pair15c;
pair15c = make_pair(2.0, 2.0);
coordinates.push_back(pair15c);
pair<double, double> pair15d;
pair15d = make_pair(23.1, 2.0);
coordinates.push_back(pair15d);
// Ursa Minor
pair<double, double> pair16a;
pair16a = make_pair(2.5, 89.0);
coordinates.push_back(pair16a);
pair<double, double> pair16b;
pair16b = make_pair(15.0, 89.0);
coordinates.push_back(pair16b);
pair<double, double> pair16c;
pair16c = make_pair(2.5, 70.0);
coordinates.push_back(pair16c);
pair<double, double> pair16d;
pair16d = make_pair(15.0, 70.0);
coordinates.push_back(pair16d);
// Ursa Major
pair<double, double> pair17a;
pair17a = make_pair(13.7, 61.0);
coordinates.push_back(pair17a);
pair<double, double> pair17b;
pair17b = make_pair(8.6, 61.0);
coordinates.push_back(pair17b);
pair<double, double> pair1c;
pair17c = make_pair(13.7, 32.0);
coordinates.push_back(pair17c);
pair<double, double> pair1d;
pair17d = make_pair(8.6, 32.0);
coordinates.push_back(pair17d);
}
=======
void viewWindow (vector <pair<double,double>> corners, pair<double,double> constellationCoord) {
pair<double,double> coordinates1;
......@@ -575,4 +700,3 @@ void viewWindow (vector <pair<double,double>> corners, pair<double,double> const
cout << "Constellation is not in view" << endl;
}
}
>>>>>>> 4e1ad8624316617b8f087e4405e4375a485173e0
......@@ -21,3 +21,6 @@ Who does what (tentative):
- Pass user input to algorithm (Brandon and Moses)
- User interface (Elon)
- Algorithm (Eric)
-
The project that Eric, Brandon
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment