Added descriptions to problems that didn't have any

This commit is contained in:
2020-06-06 18:17:13 -04:00
parent a841942741
commit 0f6f4fe0be
4 changed files with 18 additions and 18 deletions

View File

@@ -29,6 +29,17 @@
#include "../Headers/Problem28.hpp"
Problem28::Problem28() : Problem("What is the sum of the number on the diagonals in a 1001 x 1001 spiral formed by starting with the number 1 and moving to the right in a clockwise direction?"){
//Set the size of the grid to 1001 x 1001
for(int cnt = 0;cnt < 1001;++cnt){
grid.emplace_back();
for(int location = 0;location < 1001;++location){
grid.at(cnt).push_back(0);
}
}
sumOfDiagonals = 0;
}
//Sets up the grid
void Problem28::setupGrid(){
bool finalLocation = false; //A flag to indicate if the final location to be filled has been reached
@@ -95,17 +106,6 @@ void Problem28::findSum(){
}
}
Problem28::Problem28(){
//Set the size of the grid to 1001 x 1001
for(int cnt = 0;cnt < 1001;++cnt){
grid.emplace_back();
for(int location = 0;location < 1001;++location){
grid.at(cnt).push_back(0);
}
}
sumOfDiagonals = 0;
}
void Problem28::solve(){
//If the problem has already been solved do nothing and end the function
if(solved){