mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Updated various typoes and removed some unneeded code
This commit is contained in:
@@ -35,7 +35,7 @@ int Problem15::LENGTH = 20; //The length of the grid
|
||||
|
||||
//This function acts as a handler for moving the position on the grid and counting the distance
|
||||
//It moves right first, then down
|
||||
void Problem15::move(int currentX, int currentY, uint64_t& numOfRoutes){
|
||||
void Problem15::move(int currentX, int currentY){
|
||||
//Check if you are at the end
|
||||
if((currentX == WIDTH) && (currentY == LENGTH)){
|
||||
++numOfRoutes;
|
||||
@@ -44,12 +44,12 @@ void Problem15::move(int currentX, int currentY, uint64_t& numOfRoutes){
|
||||
|
||||
//Move right if possible
|
||||
if(currentX < WIDTH){
|
||||
move(currentX + 1, currentY, numOfRoutes);
|
||||
move(currentX + 1, currentY);
|
||||
}
|
||||
|
||||
//Move down if possible
|
||||
if(currentY < LENGTH){
|
||||
move(currentX, currentY + 1, numOfRoutes);
|
||||
move(currentX, currentY + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ void Problem15::solve(){
|
||||
|
||||
//We write this as a recursive function
|
||||
//When in a location it always moves right first, then down
|
||||
move(currentX, currentY, numOfRoutes);
|
||||
move(currentX, currentY);
|
||||
|
||||
//Stop the timer
|
||||
timer.stop();
|
||||
|
||||
Reference in New Issue
Block a user