mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Added descriptions to problems that didn't have any
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user