// Especially when obvious. I could have further obfuscated this but not obfuscating it *is* the point I'm making.

// Rust: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021

fn main() {

let mut q = vec![

"programming",

"functional",

"have",

"should",

"comments",

"sufficient",

"explain",

"to",

"is",

"what",

"on",

"going",

];

let mut z = q.clone();

let mut index = 0;

z.retain(|_| {

index +=1; (index%2) == 0});

q.retain(|_| { index+=1; (index%2) == 1});

println!("QED: {}", z.iter().zip(q.iter()).collect::>().iter().flat_map(|effadoodledo| std::iter::once(effadoodledo.0).chain(std::iter::once(effadoodledo.1))).collect::>().iter().fold(String::new(), |effadoodlewho, &effadoodletwo| effadoodlewho + effadoodletwo + " "));

}

Reply to this note

Please Login to reply.

Discussion

No replies yet.