Old lady swallowed a fly: Difference between revisions
Content added Content deleted
(Added Julia language) |
m (→{{header|Rust}}: Spacing.) |
||
Line 2,075: | Line 2,075: | ||
for (i, a) in animals.iter().enumerate().rev() { |
for (i, a) in animals.iter().enumerate().rev() { |
||
println!("There was an old lady who swallowed a {}\n{}", a.0, a.2); |
println!("There was an old lady who swallowed a {}\n{}", a.0, a.2); |
||
if let Die = a.1 {break} |
if let Die = a.1 {break} |
||
for (swallowed, to_catch) in animals[i..].iter().zip(&animals[i+1..]) { |
for (swallowed, to_catch) in animals[i..].iter().zip(&animals[i+1..]) { |
||
println!("She swallowed the {} to catch the {}.", swallowed.0, to_catch.0); |
println!("She swallowed the {} to catch the {}.", swallowed.0, to_catch.0); |
||
if let Every = to_catch.1 { |
if let Every = to_catch.1 { |
||
println!("{}", to_catch.2); |
println!("{}", to_catch.2); |
||
} |
} |
||
} |
} |
||
println!("Perhaps she'll die.\n"); |
println!("Perhaps she'll die.\n"); |
||
} |
} |