mirror of
https://bitbucket.org/Mattrixwv/projecteulerrust.git
synced 2025-12-06 17:43:58 -05:00
Adjusted to match C++ and Java double invert
This commit is contained in:
@@ -73,17 +73,19 @@ impl PartialEq for Location{
|
|||||||
|
|
||||||
pub fn solve() -> Answer{
|
pub fn solve() -> Answer{
|
||||||
let NUM_ROWS = 15;
|
let NUM_ROWS = 15;
|
||||||
//Start the timer
|
|
||||||
let mut timer = myClasses::Stopwatch::Stopwatch::new();
|
|
||||||
timer.start();
|
|
||||||
|
|
||||||
//Setup the list you are trying to find a path through
|
//Setup the list you are trying to find a path through
|
||||||
|
//Reserve space for the list
|
||||||
let mut list = Vec::<Vec::<i32>>::new();
|
let mut list = Vec::<Vec::<i32>>::new();
|
||||||
for _ in 0..NUM_ROWS{
|
for _ in 0..NUM_ROWS{
|
||||||
list.push(Vec::<i32>::new());
|
list.push(Vec::<i32>::new());
|
||||||
}
|
}
|
||||||
|
//Setup the list
|
||||||
setupList(&mut list);
|
setupList(&mut list);
|
||||||
|
|
||||||
|
//Start the timer
|
||||||
|
let mut timer = myClasses::Stopwatch::Stopwatch::new();
|
||||||
|
timer.start();
|
||||||
|
|
||||||
//Invert the list
|
//Invert the list
|
||||||
invert(&mut list);
|
invert(&mut list);
|
||||||
|
|
||||||
@@ -128,6 +130,9 @@ pub fn solve() -> Answer{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Invert the list again so you get the correct list
|
||||||
|
invert(&mut list);
|
||||||
|
|
||||||
//Stop the timer
|
//Stop the timer
|
||||||
timer.stop();
|
timer.stop();
|
||||||
|
|
||||||
|
|||||||
@@ -158,17 +158,18 @@ impl PartialEq for Location{
|
|||||||
|
|
||||||
pub fn solve() -> Answer{
|
pub fn solve() -> Answer{
|
||||||
let NUM_ROWS = 100;
|
let NUM_ROWS = 100;
|
||||||
//Start the timer
|
|
||||||
let mut timer = myClasses::Stopwatch::Stopwatch::new();
|
|
||||||
timer.start();
|
|
||||||
|
|
||||||
//Setup the list you are trying to find a path through
|
//Setup the list you are trying to find a path through
|
||||||
|
//Reserve space for the list
|
||||||
let mut list = Vec::<Vec::<i32>>::new();
|
let mut list = Vec::<Vec::<i32>>::new();
|
||||||
for _ in 0..NUM_ROWS{
|
for _ in 0..NUM_ROWS{
|
||||||
list.push(Vec::<i32>::new());
|
list.push(Vec::<i32>::new());
|
||||||
}
|
}
|
||||||
setupList(&mut list);
|
setupList(&mut list);
|
||||||
|
|
||||||
|
//Start the timer
|
||||||
|
let mut timer = myClasses::Stopwatch::Stopwatch::new();
|
||||||
|
timer.start();
|
||||||
|
|
||||||
//Invert the list
|
//Invert the list
|
||||||
invert(&mut list);
|
invert(&mut list);
|
||||||
|
|
||||||
@@ -213,6 +214,9 @@ pub fn solve() -> Answer{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Invert the list again so you get the correct list
|
||||||
|
invert(&mut list);
|
||||||
|
|
||||||
//Stop the timer
|
//Stop the timer
|
||||||
timer.stop();
|
timer.stop();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user