Mad Libs: Difference between revisions

m
(→‎{{header|rust}}: Rust version)
Line 2,457:
io::stdin()
.read_line(&mut input_line)
.ok()
.expect("The read line failed.");
if input_line.trim() == "".is_empty() {
break;
}
Line 2,471 ⟶ 2,470:
.map(|x| (x.get(0).unwrap().as_str().to_string(), "".to_string()))
.collect();
if parts.lenis_empty() == 0 {
println!("No <parts> to replace.\n");
} else {
Line 2,478 ⟶ 2,477:
io::stdin()
.read_line(&mut input_line)
.ok()
.expect("The read line failed.");
*v = input_line.trim().to_string();
println!("");
template = template.replace(k, v);
input_line.clear();
Line 2,509 ⟶ 2,507:
found a puppy. John Wick decided to take it home.
</pre>
 
=={{header|Scala}}==
<lang Scala>object MadLibs extends App{
Anonymous user