Changed Problem 67 to work with 18

This commit is contained in:
2020-07-25 16:02:49 -04:00
parent 3ed2de1dff
commit 44be9aa5b0
5 changed files with 147 additions and 334 deletions

View File

@@ -58,13 +58,10 @@ private:
int yLocation;
int total;
bool fromRight;
location(int x, int y, int t, bool r) : xLocation(x), yLocation(y), total(t), fromRight(r){ }
location(int x, int y, int t, bool r) : xLocation(x), yLocation(y), total(t), fromRight(r){}
};
//Variables
//Static variables
static const int NUM_ROWS = 15; //The number of rows in the array
static std::vector<int> list[NUM_ROWS]; //Setup the list you are trying to find a path through
//Instance variables
std::list<location> foundPoints; //For the points that I have already found the shortest distance to
std::list<location> possiblePoints; //For the locations you are checking this round
@@ -72,6 +69,11 @@ private:
//Functions
void invert(); //This list turns every number in the vector into 100 - num
void setupList();
protected:
//Variables
//Static variables
static std::vector<std::vector<int>> list; //Setup the list you are trying to find a path through
public:
//Constructor
Problem18();