mirror of
https://bitbucket.org/Mattrixwv/projecteulerjava.git
synced 2025-12-06 17:13:58 -05:00
Fixed issue with the 0 option not solving all problems
This commit is contained in:
@@ -83,10 +83,10 @@ public class Driver{
|
||||
//This selection solves all problems in order
|
||||
if(problemNumber.equals(0)){
|
||||
//Solve to every valid problem number, skipping over 0
|
||||
for(Integer problemLocation = 1;problemLocation < PROBLEM_NUMBERS.size();++problemLocation){
|
||||
//Solve the problem
|
||||
for(Integer problemLocation = PROBLEM_NUMBERS.get(1);problemLocation < PROBLEM_NUMBERS.size();++problemLocation){
|
||||
//Solve the problems
|
||||
System.out.print(PROBLEM_NUMBERS.get(problemLocation).toString() + ". ");
|
||||
solveProblem(problemLocation);
|
||||
solveProblem(PROBLEM_NUMBERS.get(problemLocation));
|
||||
}
|
||||
}
|
||||
//This is if a single problem number was chosen
|
||||
@@ -99,8 +99,7 @@ public class Driver{
|
||||
//Get the problem
|
||||
Problem problem = getProblem(problemNumber);
|
||||
//Print the problem description
|
||||
String description = problem.getDescription();
|
||||
System.out.println(description);
|
||||
System.out.println(problem.getDescription());
|
||||
//Solve the problem
|
||||
problem.solve();
|
||||
//Print the results
|
||||
@@ -153,10 +152,10 @@ public class Driver{
|
||||
//If the problem number is 0 print out all the descriptions
|
||||
if(problemNumber.equals(0)){
|
||||
//Print description for every valid problem number, skipping over 0
|
||||
for(Integer problemLocation = PROBLEM_NUMBERS.get(1);problemLocation < PROBLEM_NUMBERS.size();++problemLocation){
|
||||
for(Integer problemLocation = 1;problemLocation < PROBLEM_NUMBERS.size();++problemLocation){
|
||||
//Print the problem's description
|
||||
System.out.print(PROBLEM_NUMBERS.get(problemLocation) + ". ");
|
||||
printDescription(problemLocation);
|
||||
printDescription(PROBLEM_NUMBERS.get(problemLocation));
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user