Added solution to problem 15

This commit is contained in:
2020-06-16 19:01:04 -04:00
parent c5f395baf8
commit 7faccbcade
3 changed files with 89 additions and 1 deletions

View File

@@ -33,7 +33,8 @@ mod Problems;
#[derive(PartialEq)]
enum Selections{EMPTY, SOLVE, DESCRIPTION, LIST, EXIT, SIZE}
static problemNumbers: [u32; 15] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
static problemNumbers: [u32; 16] = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15];
fn main(){
let mut selection = Selections::EMPTY;
@@ -186,6 +187,10 @@ fn solveProblem(problemNumber: u32){
println!("{}", Problems::Problem14::getDescription());
println!("{}", Problems::Problem14::solve());
}
else if(problemNumber == 15){
println!("{}", Problems::Problem15::getDescription());
println!("{}", Problems::Problem15::solve());
}
}
fn descriptionMenu(){
//Give some extra space to print the description
@@ -253,6 +258,9 @@ fn printDescription(problemNumber: u32){
else if(problemNumber == 14){
println!("{}", Problems::Problem14::getDescription());
}
else if(problemNumber == 15){
println!("{}", Problems::Problem15::getDescription());
}
}
fn getProblemNumber() -> u32{
println!("Enter a problem number: ");