Skip to content
Snippets Groups Projects
Commit b162b995 authored by Henrik Tjäder's avatar Henrik Tjäder
Browse files

Print the result twice

parent 0535a638
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ fn main() { ...@@ -13,7 +13,7 @@ fn main() {
let mut tries_counter : u32 = 0; let mut tries_counter : u32 = 0;
let mut attempt_history = Vec::<(u32, String)>::new(); let mut attempt_history = Vec::<(u32, String)>::new();
//println!("The secret number is: {}", secret_number); println!("The secret number is: {}", secret_number);
loop { loop {
...@@ -39,6 +39,11 @@ fn main() { ...@@ -39,6 +39,11 @@ fn main() {
Ordering::Equal => { Ordering::Equal => {
println!("You win!"); println!("You win!");
println!("Total number of attempts: {}", tries_counter); println!("Total number of attempts: {}", tries_counter);
println!("First print:");
for x in attempt_history.iter() {
println!("{:?}", x);
}
println!("\nSecond print:");
for x in attempt_history.iter() { for x in attempt_history.iter() {
println!("{:?}", x); println!("{:?}", x);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment