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{
|
||||
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
|
||||
//Reserve space for the list
|
||||
let mut list = Vec::<Vec::<i32>>::new();
|
||||
for _ in 0..NUM_ROWS{
|
||||
list.push(Vec::<i32>::new());
|
||||
}
|
||||
//Setup the list
|
||||
setupList(&mut list);
|
||||
|
||||
//Start the timer
|
||||
let mut timer = myClasses::Stopwatch::Stopwatch::new();
|
||||
timer.start();
|
||||
|
||||
//Invert the 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
|
||||
timer.stop();
|
||||
|
||||
|
||||
@@ -158,17 +158,18 @@ impl PartialEq for Location{
|
||||
|
||||
pub fn solve() -> Answer{
|
||||
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
|
||||
//Reserve space for the list
|
||||
let mut list = Vec::<Vec::<i32>>::new();
|
||||
for _ in 0..NUM_ROWS{
|
||||
list.push(Vec::<i32>::new());
|
||||
}
|
||||
setupList(&mut list);
|
||||
|
||||
//Start the timer
|
||||
let mut timer = myClasses::Stopwatch::Stopwatch::new();
|
||||
timer.start();
|
||||
|
||||
//Invert the 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
|
||||
timer.stop();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user